How to define a job to run only once and only if any of its predecessors ended abnormally.

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

Solution:

   Objective: Job CYBER99 has 4 predecessors: job CYBER01, CYBER02, CYBER03, and CYBER04.  

   Job CYBER99 runs once, and only if any of its 4 predecessor jobs had abended or ended with a non-zero condition code.   

Here's a sample application:

APPL CYBER

JCLLIB 'CYBER.JCLLIB'

CCCHK RC(1:4095) Fail Continue

 

JOB CYBER01

  RUN DAILY

  RELEASE ADD(CYBER99(A))

ENDJOB

 

JOB CYBER02

 RUN DAILY

 RELEASE ADD(CYBER99(A))

ENDJOB

 

JOB CYBER03

 RUN DAILY

 RELEASE ADD(CYBER99(A))

ENDJOB

 

JOB CYBER04

 RUN DAILY

 RELEASE ADD(CYBER99(A))

ENDJOB

 

JOB CYBER99 CONDITIONAL   =>  This job is bypassed if not executed  

 RUN DAILY

 RELCOUNT 3                         =>  This job runs after one predecessor is satisfied.  It does not wait for all 4 predecessors.

ENDJOB

 

Note: RELCOUNT represents the number of predecessors that does not have to be satisfied for this job to run.