Setup an application to trigger one job if file is avail or another if file is not available in ESP
search cancel

Setup an application to trigger one job if file is avail or another if file is not available in ESP

book

Article ID: 9908

calendar_today

Updated On:

Products

ESP Workload Automation

Issue/Introduction

Job is set up on the mainframe but it is using ConnectDirect (NDM) to collect the files. The job returns a RC 0 regardless because it is on the submitted status instead of completion.

To address this issue, two new jobs are created.  One job for completing with RC 0 if the file is there, and one job with RC 8 when the file is not there.  
Example:

JOB #NDMTEST
MEMBER #NDMTEST
CCCHK RC(0:7) OK CONTINUE
RELEASE (#CDGOOD, #CDBAD(A))
RUN DAILY
ENDJOB

JOB #CDGOOD
MEMBER #CDGOOD
CCCHK RC(1:4095) FAIL CONTINUE
RUN DAILY
ENDJOB

JOB #CDBAD CONDITIONAL
MEMBER #CDBAD
CCCHK RC(8) FAIL CONTINUE
RUN DAILY
ENDJOB

Is there a better method? 

Resolution

The connect direct (NDM) job needs to return the proper condition code to ESP when it fails. ESP reacts on conditions and if none is passed it will consider the job successful. 
The solution is to add a step to the JCL to execute the IBM utility DMBATCH.   This allows ESP to report the failure on every step that is tested.