How to conditionally complete an application based on the completion code returned by one of its jobs?
If job A does not complete, its conditional success task CHECK.A will complete the application. CHECK.A is a self-completing task.
If job A completes normally, it releases B, B releases C. Task CHECK.A is bypassed due to the 'conditional' parameter.
Example:
APPL DEMO
JCLLIB 'DEMO.JCLLIB'
CCCHK RC(1:4095) FAIL
JOB A
RUN ANY
MEMBER A
RELEASE (B,CHECK.A(A))
ENDJOB
JOB CHECK.A TASK CONDITIONAL
RUN ANY
ESPNOMSG AJ ALL APPL(%ESPAPPL..%ESPAPGEN) COMPLETE
ENDJOB
JOB B
RUN ANY
MEMBER B
RELEASE C
ENDJOB
JOB C
RUN ANY
MEMBER C
ENDJOB
The use of the ESPAPPL and ESPAPGEN symbolic variables is recommended over any other implementation.