JOBRC Parameter


Note! JOBRC parameter can be coded only at the job level.

JOBRC means the JOB Return Code. The JOBRC parameter is used to control how the job return code is set. It is a keyword parameter and optional.

Syntax -

JOBRC={MAXRC}
      {LASTRC}
      {(STEP,step-name[.proc-step-name]}
MAXRC The job return code is set to the highest return code of any step or the abend code if the job fails.
MAXRC is the default if not coded.
LASTRC The job return code is set from the last step return code.
STEP,step-name[.proc-step-name] The job return code is set from the proc-step-name.
If the step does not exist, a JCL error occurs.

Default and overrides -

If the parameter is not coded, the job CLASS sets MAXRC as a return code of the job.

Examples -


Scenario1 - Ignore JOBRC parameter.

//MTHEXMP1 JOB (MTH123),'PAWAN Y',NOTIFY=&SYSUID 

The job CLASS sets MAXRC as the complete code of the job.

Scenario2 - Set LASTRC as JOBRC.

//MTHEXMP2 JOB (MTH123),'PAWAN Y',JOBRC=LASTRC,NOTIFY=&SYSUID 

The last executed step return code sets as the completion code of the job.

Scenario3 - Set STEP01 return code as JOBRC.

//MTHEXMP3 JOB (MTH123),'PAWAN Y',JOBRC=(STEP,STEP01),
//                      NOTIFY=&SYSUID 

Step STEP01 return code sets as the completion code (CC) of the job.