Run a Job in ESP from 4am to 11pm on the hour, then 11pm to 4am every 15 min.
search cancel

Run a Job in ESP from 4am to 11pm on the hour, then 11pm to 4am every 15 min.

book

Article ID: 38719

calendar_today

Updated On:

Products

ESP Workload Automation

Issue/Introduction

Is it possible to schedule jobs from 4am to 11pm on the hour, then 11pm to 4am every 15 min? If the job encounters certain conditions two other jobs need to run.

Environment

Release : 12.0
Component : ESP WORKLOAD AUTOMATION

Resolution

The best approach is having two events schedule within the same application. The first event will schedule the application from 4am to 11pm every hour and then suspend at 11pm, resuming at 4am.  The second event will run from 11pm until 4am and suspend at 4am, resuming at 11pm.

Example:

Creating two events will allow you to schedule one application on a daily basis at the times specified. See example below of the two events setup to handle your requirement.

1) First define event that will schedule/resume daily every 15 mins starting at 2300 hrs, and suspend at 0400 hrs. Should invoke the same proc as test.event2.


EVENT ID(TEST.EVENT1) SYSTEM(ESPx) REPLACE
RESUME 23.00 DAILY STARTING TUE 26TH JAN 2016
SCHEDULE 23.00 EVERY 15 MINUTES STARTING TUE 26TH JAN 2016
SUSPEND 04.00 DAILY STARTING WED 27TH JAN 2016
INVOKE '<hlq.proc>(<member>)'
ENDDEF

2) Second define event that will schedule/resume daily every hour starting at 0400 hrs, and suspend at 2300 hrs. Should invoke the same proc as test.event1.


EVENT ID(TEST.EVENT2) SYSTEM(ESPx) REPLACE
SUSPEND 23.00 DAILY STARTING TUE 26TH JAN 2016
SCHEDULE 04.00 HOURLY STARTING WED 27TH JAN 2016
RESUME 04.00 DAILY STARTING WED 27TH JAN 2016
INVOKE '<hlq.proc>(<member>)'

3) Define an application that uses CONDITIONAL jobs. Conditional means jobs may or may not run based on completion code checking.
     
In the defined application when PRDFLOGP runs successfully, the other two jobs PRDCLOGT and DUMMY will be bypassed.  The event will then retrigger at its designated time.

In the defined application when PRDFLOGP fails, the second job PRDCLOGT will run. PRDCLOGT will release the DUMMY job and this task will force complete PRDFLOGP. The event will then retrigger at its designated time.


JOB PRDFLOGP
CCCHK RC(1:4095) FAIL STOP
CCCHK RC(0) OK CONTINUE
NOTIFY ABEND FAILURE USERS(<user>)
NOTIFY ABEND FAILURE MAILBOX(XX)                                                                                                                                                                                       
RUN DAILYRELEASE ADD(PRDCLOGT(A))                                                                                                                                                                           
ENDJOB

JOB PRDCLOGT CONDITIONAL
NOTIFY ABEND FAILURE USERS(<user>)                                                                                                                                                              
NOTIFY ABEND FAILURE MAILBOX(XX)                                                                                                                                                                         
ESPNOMSG AJ DUMMY COMPLETE APPL(%ESPAPPL..%ESPAPGEN)                                                                                                                                       
DELAYSUB NOW PLUS 1 MINUTE                                                                                                                                                                                            
RUN DAILY                                                                                                                                                                                                                    
RELEASE ADD(DUMMY)                                                                                                                                                                                                    
ENDJOB

JOB DUMMY TASK PROCESS CONDITIONAL
ESPNOMSG AJ PRDCLOGT COMPLETE APPL(%ESPAPPL..%ESPAPGEN)                                                                                                                                        
RUN DAILY                                                                                                                                                                                                                         
ENDJOB