Setting up an application to trigger one job if file is avail or another if file is not available in CA Workload Automation ESP Edition.

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

Setting up an application to trigger one job if file is avail or another if file is not available

Background:

Working with an application that is retrieving a file. The job is set up on the mainframe but it using ConnectDirect to collect the files. The job is running and returning a RC 0 regardless because we are getting it on the submitted status instead of completion. We created 2 other jobs; one for completing with RC 0 if the file is there and one with RC 8 when the file is not there.
We set up a condition on the appl but conditional doesn't pull any bad return code it just get bypass if the file is not there. We are not getting the bad return code and we need the process to fail if there is no file.  Is there an easier way to do this?
This is how the appl is set up right now

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

Instructions:

The connect direct 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 job successful. Add the DMBATCH step to the JCL and ESP reported the failure on every step we tested.