• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 784
  • Last Modified:

How do we get run time of robo jobs programatically ?

Hi,

I have one requriment to built. We have few robo jobs which are scheduled through out the day. We have approx run time for all jobs. What I need is if any of these job takes more then that estimated time then we will generate a report which we can motitor everyday.

Problem with this is how can I get the the run time for robot job programatically ?

Thanks for help in advance....

Regards
Prashant Patel
0
inform_prashant
Asked:
inform_prashant
  • 2
  • 2
  • 2
2 Solutions
 
tliottaCommented:
Prashant:

There is a variety of ways. Two possibilities:

1. Start up job accounting -- the accounting journal entries for the job should give you what you need. Job starting date/time is in the entry; job ending date/time is the date/time of the journal entry itself.

2. Process QHST* files to interpret entries for the dates involved and for the jobs you want. The message IDs are CPF1124 for start and CPF1164 for end. These can be tricky files to process correctly.

Tom
0
 
_b_hCommented:
Prashant
Are you using Help Systems Robot/Scheduler?
Job monitors allow you to monitor your job schedule for specific events,
such as jobs that run too long, complete too quickly, or start later than
their scheduled run time. You can specify the criteria for each monitored
job at setup time. You also specify what Robot/SCHEDULE should do if
it identifies a job monitor event. Robot/SCHEDULE can end a job or
notify you by sending a message to the job’s message queue; sending a
text, e-mail, or pager message via Robot/ALERT; or sending a status to
the Robot/NETWORK Status Center.
When a monitored job reaches one or more of the criteria defined on the
Job Monitors panel, Robot/SCHEDULE takes the specified action and
enters a record in the job monitor event log.
The Job Monitor Events Report lists all monitored events that have occurred
on the system. You can print the report from the Job History Report
Selection panel; starting at the Robot/Scheduler Main Menu, take option 3) Control Menu, then 6) Job History Reports.
If you need to query the Robot database directly, please post back!
Barry
0
 
inform_prashantAuthor Commented:
Tom,

Thaks for replying....How can we start job accounting and the how can we read that in program.(Sorry if this is a very basic question !!)

Barry,

Thanks to you for your reply...I saw 'Job histroy Report' and I think 'Good Morning Report' will be very useful for me becuase I was looking for a report which will advice me about jobs which took long and varied from its expected time. But I have 3 questions regarding that.
1) When we give 'Runtime Devation (%)' how it calculates the avarager runt time to find out the deviation.
2) What is Forecast name and how can we use that ?
3) Once we schedule this job on ROBOT then how can we manage to send that spoll file to e-mail few of the guys ? Can we copy that file into stram file and then send that file via SNDDST ?

Thanks to both of you again for your reply...

Regards
Prashant Patel
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
_b_hCommented:
Hi Prashant

The Good Morning Report runs several reports at the same time, including a job summary. Reviewing and archiving the summary report is often required by SARBOX.

1) The documentation says that it averages the runtimes and reports on those outside of the runtime deviation percentage.

2) You can create a forecast of how the scheduler predicts the jobs will run. The report will show the variances between the actual run times and the forecast.

3) You can schedule the Good Morning Report using a program like the sample source below.

PGM
DCL &TODAY      *CHAR     6
DCL &TODAYN     *DEC   (6 0)
DCL &YESDAY     *CHAR     6
DCL &YESDAYN    *DEC   (6 0)
DCL &INCDAT     *DEC   (6 0)
DCL &DESC       *CHAR    44
DCL &REPORT      *CHAR    12   /* NAME OF REPORT                     */
             ADDLIBLE   LIB(ROBOTLIB)
             MONMSG CPF2100
             /*                                                     */
             /* CALCULATE YESTERDAY'S DATE                          */
             /*                                                     */
             RTVJOBA    DATE(&TODAY)
             CHGVAR  &TODAYN  &TODAY
             CHGVAR  &YESDAYN &TODAYN
             CHGVAR  &INCDAT  1
             CALL ROBOTLIB/RBT802 (&YESDAYN &INCDAT '-' 'STANDARD  ')
             CHGVAR  &YESDAY  &YESDAYN
         /*** if you need to re-run the report, use this ***/
        /*** CHGVAR  &YESDAY  '071004'    /**RERUN****/
             SNDPGMMSG &YESDAY
             /*                                                     */
             /* CREATE GOOD MORNING REPORTS                         */
             /*                                                     */
             OVRPRTF RB9401P4 HOLD(*YES)
             OVRPRTF RB9401P3 HOLD(*YES)
             OVRPRTF RB9401P2 HOLD(*YES)
             OVRPRTF    FILE(RB9401P1) HOLD(*YES)
             ROBOTLIB/RBTGM FRM_DATE(&YESDAY) FRM_TIME(2000) +
                          TO_DATE(*CURRENT)
             /*                                                     */
             /* EMAIL REPORT                                        */
             /*                                                     */
             CHGVAR &DESC  'Good morning report WITH ABENDS'
             CRTPF      FILE(QTEMP/GOODM) RCDLEN(132) SIZE(500000)
             MONMSG (CPF7300)
             CPYSPLF    FILE(RB9401P1 ) TOFILE(QTEMP/GOODM  ) +
                          SPLNBR(*LAST) MBROPT(*REPLACE)
             CPYSPLF    FILE(RB9401P2) TOFILE(QTEMP/GOODM) +
                          SPLNBR(*LAST) MBROPT(*ADD)
             MONMSG (CPF3300) EXEC(DO) /* NO ABENDS FOUND   */
                CHGVAR &DESC  'Good morning report'
                ENDDO
             CVTDAT     DATE(&TODAY) TOVAR(&TODAY) TOFMT(*YMD) +
                          TOSEP(*NONE)
             CHGVAR &REPORT  VALUE('GM' || &TODAY || '.TXT')
             CPYF       FROMFILE(AUDIT/GOODM) TOFILE(QTEMP/GOODM) +
                          MBROPT(*ADD)
             CPYTOPCD   FROMFILE(QTEMP/GOODM) TOFLR(OPS) +
                          TODOC(&REPORT  ) REPLACE(*YES)
             /* FTP THE REPORT TO THE REPOSITORY */
             <insert your own FTP here>
             /* Email the report */
             SNDDST     TYPE(*DOC) +
                          TOINTNET((prashant@prashantcompany.com) +
                          (someoneelse@prashantcompany.com)) DSTD(&DESC) +
                          MSG(&DESC) DOC(&REPORT) FLR(OPS) +
                          SUBJECT(&DESC)
             ENDPGM

If you have any questions, please post back!
Barry
0
 
tliottaCommented:
Prashant:

Barry's familiarity with ROBOT seems like a strong possibility for you.

For your later questions...

First, verify that job accounting is not already active. The existence of the system accounting journal plus a value that includes *JOB in system value QACGLVL should tell you if accounting is active. The accounting journal is named QSYS/QACGJRN.

You can process the journal by using either DSPJRN to an *OUTFILE and reading the file or RCVJRNE to receive entries directly into a variable. (There are also Journal APIs for both OPM and ILE, but it might be easier to learn what the commands do first.) If you use DSPJRN, you should first create the *OUTFILE by duplicating the model file from QSYS into a work library. The file is QSYS/QAJBACG for basic entries of *TYPE1 and QSYS/QAJBACG4 for *TYPE4. Use CRTDUPOBJ to create your work file. This can be done interactively to get a feel for the results. Do _NOT_ use the file in QSYS to display journal entries into.

Minor note on SNDDST... You can send a streamfile with SNDDST, but I'm not sure if it's possible to send a streamfile that isn't in the /QDLS file system. That might be an issue if you're creating this programming for a customer. Using the SMTP functions might be a better choice. The QtmmSendMail API is one way to get into SMTP mail functions.

Tom
0
 
inform_prashantAuthor Commented:
Hi Barry,

I think I have got everything ..Thanks a lot...I will also keep in mind Tom's note.

Thanks again to both of your for your help....I will keep this question for any help till I designe the prototype of this. Just for my information Barry, you also said that if you I want to query ROBOT databse directly then post back....How can we do that ????

Thanks again...

Regards
Prashant Patel
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now