Solved

How do we get run time of robo jobs programatically ?

Posted on 2007-03-29
6
734 Views
Last Modified: 2013-12-06
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
Comment
Question by:inform_prashant
  • 2
  • 2
  • 2
6 Comments
 
LVL 27

Expert Comment

by:tliotta
ID: 18820525
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
 
LVL 13

Expert Comment

by:_b_h
ID: 18821472
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
 

Author Comment

by:inform_prashant
ID: 18834648
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 13

Accepted Solution

by:
_b_h earned 200 total points
ID: 18838248
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
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 50 total points
ID: 18838383
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
 

Author Comment

by:inform_prashant
ID: 18841574
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now