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

Document ID : KB000012178
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

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

Environment:
CA WA ESP Edition Z/OS
Answer:

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