Need a job to run within ESPWA from 4am to 11pm on the hour, then 11pm -4am every 15 min.

book

Article ID: 38719

calendar_today

Updated On:

Products

CA Workload Automation ESP Edition

Issue/Introduction

QUESTION:

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.

ANSWER:

The best approach would be to have two events schedule 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.

For Example:

Creating two events will allow you to schedule one application on a daily basis at the times specified. Below you will see the example 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(ESPM) 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 'TEST.ESP.PROC(PROC1)'
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(ESPM) 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 'TEST.ESP.PROC(PROC1)'

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.

********************************* Top of Data *********************                                                                                                                      APPL PRDFLOGP 

                                                                                                                                                                                                                                       JCLLIB 'CYB.ESP.JCLLIB'


JOB PRDFLOGP
CCCHK RC(1:4095) FAIL STOP
CCCHK RC(0) OK CONTINUE
NOTIFY ABEND FAILURE USERS(PANOES,PREVJA)                                                                                                                                                                NOTIFY ABEND FAILURE MAILBOX(DB)                                                                                                                                                                                   RUN DAILYRELEASE ADD(PRDCLOGT(A))                                                                                                                                                                           ENDJOB

JOB PRDCLOGT CONDITIONAL
NOTIFY ABEND FAILURE USERS(PANOES,PREVJA)                                                                                                                                                              NOTIFY ABEND FAILURE MAILBOX(DB)                                                                                                                                                                         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
******************************** Bottom of Data ******************

 

 

 

Environment

Release: ENCWLA00200-11.4-Workload Automation-Restart Option-EE
Component: