[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


How do we get run time of robo jobs programatically ?

Posted on 2007-03-29
Medium Priority
Last Modified: 2013-12-06

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....

Prashant Patel
Question by:inform_prashant
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
LVL 27

Expert Comment

ID: 18820525

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.

LVL 13

Expert Comment

ID: 18821472
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!

Author Comment

ID: 18834648

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 !!)


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...

Prashant Patel

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

LVL 13

Accepted Solution

_b_h earned 800 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.

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                     */
             MONMSG CPF2100
             /*                                                     */
             /* CALCULATE YESTERDAY'S DATE                          */
             /*                                                     */
             RTVJOBA    DATE(&TODAY)
             CHGVAR  &TODAYN  &TODAY
             CHGVAR  &INCDAT  1
             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)
             /*                                                     */
             /* 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'
             CHGVAR &REPORT  VALUE('GM' || &TODAY || '.TXT')
                          TODOC(&REPORT  ) REPLACE(*YES)
             <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) +

If you have any questions, please post back!
LVL 27

Assisted Solution

tliotta earned 200 total points
ID: 18838383

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.


Author Comment

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...

Prashant Patel

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

649 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