Bypass a job depending on the Condition Code of another job
search cancel

Bypass a job depending on the Condition Code of another job

book

Article ID: 221129

calendar_today

Updated On:

Products

ESP Workload Automation

Issue/Introduction

Scheduling requirements: 

 Jobname Leader runs every 5 minutes between 5 AM and 10:40 AM. 

 If job returns CC=00, then trigger 2 other jobs, and bypass 2 jobs that normally run at 10:41 AM.

 If job returns CC=04, no additional job triggering is needed.  The 2 jobs that are scheduled at 10:41 AM should be allowed to run.

Environment

Release : All Releases

Component : ESP Workload Automation

Resolution

JOB Leader
  RUN ANY
  RELEASE ADD (Jobn1.rc00) COND(RC(00))
  RELEASE ADD (Jobm1.rc04) COND(RC(04))
ENDJOB

JOB Jobn1.rc00
  RUN ANY
  IF %ESPSHH EQ '10' AND %ESPSMN GE '40' AND %ESPSMN LE '45' THEN +
     ESPNOMSG AJ Mjobs BYPASS APPL(%ESPAPPL..%ESPAPGEN) 
  RELEASE ADD(Jobn2.rc00)
ENDJOB    

JOB Jobn2.rc00
  RUN ANY
ENDJOB

SUBAPPL Mjobs

JOB Jobm1.rc04
  IF %ESPSHH EQ '10' AND %ESPSMN GE '40' AND %ESPSMN LE '45' THEN +
     RUN TODAY
     EARLYSUB 10:41
  RELEASE ADD(Jobm2.rc04)
ENDJOB

JOB Jobm2.rc04
  IF %ESPSHH EQ '10' AND %ESPSMN GE '40' AND %ESPSMN LE '45' THEN +
     RUN TODAY
ENDJOB