JCL JOBRC

JCL JESLOG JCL LINES

Advertisements


JOBRC represents the JOB Return Code.

JOBRC parameter used to control how the job return code/completion code is set.

JOBRC is optional parameter.


Syntax:

JOBRC= {MAXRC}
        {LASTRC}
        {(STEP,stepname[.procstepname]}

MAXRC The job return code is set to highest return code of any step or to the abend code if the job fails with abend.

This is default if not specified any.
LASTRC The job return code is set to the last step return code or abend code.
STEP,stepname[.procstepname] The job return code is set to the stepname[.procstepname] return code or abend code.

The last matching step return code or abend code will be set if duplicate steps are exists.

JCL error occurred, if step does not exist.

If the step doesn’t execute, then it follows MAXRC for the return code.

Default and overrides:


If the parameter is not specified, the JOBCLASS sets either MAXRC or LASTRC for the specific job.

If the sub parameter value not specified, MAXRC will be used.


Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y' 

This specification indicates the JOBCLASS sets either MAXRC or LASTRC to set the completion code for the job.


Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', JOBRC=LASTRC

This specification indicates to use the return code of the last executed step as the completion code for the job.


Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', JOBRC=(STEP,STEP01)

Use the return code for the STEP01 step as the completion code for the job.


JCL JESLOG JCL LINES

Advertisements