When dSeries or ESP submits a job it adds a step to the job. The step reports back success or failure. In the case of a manual job coming from somewhere else that step is not in the job.
But
It can be added to the JCL. Below is an example of my step. In this case if the job ends with a RC 5 the job fails. Depending on the system it may need a STEPLIB. There are several options around the CCCHK statements.
//ESPCCCHK EXEC X114CCC,GROUP=DP14G
//PARMS DD *
CCCHK RC (5) FAIL CONTINUE
CCCHK RC (1:4095) OK CONTINUE
The PROC X114CCC looks like the one below.
//ESPCCCHK PROC GROUP=
//*------------------------------------------------------------------
//* The name of this JCL procedure is specified in the
//* optional CCCHKSTP initialization parameter.
//*------------------------------------------------------------------
//* This is the ESPCCCHK step which is inserted into each job
//* whose definition contains one or more CCCHK statement.
//* The name of this step must be ESPCCCHK.
//* Change the STEPLIB statement as required.
//*------------------------------------------------------------------
//ESPCCCHK EXEC PGM=CYBES080,PARM='&GROUP'
//STEPLIB DD DSN=HLQ.CD7YLOAD,DISP=SHR
//SYSIN DD DDNAME=PARMS
//SYSPRINT DD SYSOUT=(,)
NOTE:
There are two different steps depending on whether Encore is included or not. In this case it needs the one where Encore is not included.