Using JOBONCSF output to check the previous run of JOBs on CA Workload Automation ESP Edition?
search cancel

Using JOBONCSF output to check the previous run of JOBs on CA Workload Automation ESP Edition?

book

Article ID: 12178

calendar_today

Updated On:

Products

ESP Workload Automation

Issue/Introduction



Using JOBONCSF output to check the previous run of JOBs on CA Workload Automation ESP Edition

Environment

CA WA ESP Edition Z/OS

Resolution

Here is an example, TASK CHECKJOB will check if previous runs of JOBA, JOBB and JOBC got RC 0 before release JOBA:

APPL APPLTEST

JOB CHECKJOB TASK SELFCOMPLETING 

RUN ANY 

REXXON PROC 

FORCED='NO' 

J=JOBONCSF('JOBA','X') 

IF J > 0 THEN DO 

DO I=1 TO J WHILE FORCED='NO' 

IF XAPPL.I='APPLTEST' & (XFAILED.I=1 | XCONDCODE.I>0) THEN DO 

FORCED='YES' 

LEAVE 

END 

END 

END 

IF FORCED='NO' THEN DO 

K=JOBONCSF('JOBB','X') 

IF K > 0 THEN DO 

DO I=1 TO K WHILE FORCED='NO' 

IF XAPPL.I='APPLTEST' & (XFAILED.I=1 | XCONDCODE.I>0) THEN DO 

FORCED='YES' 

LEAVE 

END 

END 

END 

END 

IF FORCED='NO' THEN DO 

M=JOBONCSF('JOBC','X') 

IF M> 0 THEN DO 

DO I=1 TO M WHILE FORCED='NO' 

IF XAPPL.I='APPLTEST' & (XFAILED.I=1 | XCONDCODE.I>0) THEN DO 

FORCED='YES' 

LEAVE 

END 

END 

END 

END 

IF FORCED='YES' THEN DO 

"ESP AJ ALL COMPLETE APPL(%ESPAPPL..%ESPAPGEN)" 

END 

REXXOFF 

RELEASE JOBA 

ENDJOB