With CA Workload Automation ESP Edition, JOB1 and JOB2 are mutually exclusive by NOTWITH settings. How do you stop JOB1 from taking off when JOB2 is in abend status?

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

Description:

Based on the following set up:

If Job1 and Job2 are set up to be mutually exclusive with the ESP code:

 JOB JOB1    
    RUN ANYDAY    
    NOTWITH JOB2    
  ENDJOB
    
  JOB JOB2 
    RUN ANYDAY    
    NOTWITH JOB1    
  ENDJOB

If JOB2 abends will that stop Job1 from taking off as long as Job2 is in abend status in the queue?

Solution:

No, the HOLD operand is needed with the NOTWITH statement as follows:

 JOB JOB1 
    RUN ANYDAY    
    NOTWITH JOB2    
    ENDJOB
    
 JOB JOB2 
    RUN ANYDAY    
    NOTWITH JOB1 HOLD    
    ENDJOB

The HOLD operand causes job JOB2 to hold onto any resources it was using. This keeps job JOB1 from running until job JOB2 is forced complete, restarted successfully or rerun successfully.