Controlling how the event writer records job completion codes for specific jobs
On z/OS 1.13 and later, you can specify the JOBRC parameter in the JOB card statements of specific jobs to predefine how their completion codes are recorded in the EELEVDS event data set.
For all the jobs submitted to JES by the agent for z/OS, the RETCODE keyword of the EWTROPTS initialization statement defines which completion code the event writer records in the EELEVDS event data set for the job-end (A3J) event record, choosing from the codes returned by the job steps. The default choice for RETCODE is to set the job completion code to the return code of the last step; alternately, you can set it to choose the highest return code of any step.
For particular jobs of your choice, you can override the setting of RETCODE by specifying the JOBRC parameter in the JOB statement of the JCL. Typically, you use JOBRC to reverse for a specific job the setting defined in EWTROPTS RETCODE, which applies generally to all the workload submitted to JES by the agent for z/OS.
JOBRC
Parameters
- MAXRC
- The job completion code is set to the highest return code of any step in the job, or if the completion of the job fails because of an ABEND, the job completion code is set to the last ABEND code. This is the default parameter.
- LASTRC
- The job completion code is set to the return code or ABEND code of the last step that is executed in the job.
Example
The EWTROPTS initialization statement
of your agent for z/OS is
set with RETCODE=HIGHEST
, whereby for all jobs submitted
to JES by the agent, the job completion code returned by the event
writer is the highest return code of all the performed steps.
For
the ACCT1254JCL multistep job, however, you want the event writer
to pick the return code of the last step completed or ABENDED. You
therefore write JOBRC=LASTRC
in the JOB statement
of ACCT1254JCL.