Return code
A number a step leaves behind to say how it went. 0 is clean.
Also written RC, condition code, completion code
Why it matters. Reading the return code is the first thing you do with any job. Later steps can use it to decide whether to run.
See it
Each step ends with a return code. 0 means success.
Syntax
IEF142I jobname stepname - STEP WAS EXECUTED - COND CODE nnnn $HASP395 jobname ENDED - RC=nnnn
- 0
- Ended well.
- 4
- A warning.
- 8
- An error.
- 12
- A serious error.
- 16
- A severe error.
- Abend
- Not a return code. The step shows an Sxxx or Uxxxx code instead.
Try it SUBMIT
- 1
Send the job CLEANUP in your DEV JCL library to run. Read the last line.
SUBMIT 'ZB0001.DEV.JCL(CLEANUP)' - 2
Read the step messages, JESYSMSG. Find the step's code.
OUTPUT CLEANUP JESYSMSG - 3
Now find out why. Read what the program printed, STEP1.SYSPRINT.
OUTPUT CLEANUP STEP1.SYSPRINT
Remember
- By habit, 0 is clean, 4 a warning, 8 an error, 12 and 16 serious. The program decides what its codes mean.
- Each step has its own code. The end-of-job message gives one code for the whole job, so read the step lines.
- The code says how it went. The program's messages say why.
The usual mistake
Treating RC=0008 as a good ending, because the job finished
A job can finish and still have failed. The number tells you which.
Read the code, then the messages that explain it
On real z/OS
The meaning of 4, 8, 12 and 16 is a habit most IBM utilities follow, not a rule of the system. Each program decides its own codes, up to 4095. MF/OS shows the IDCAMS lines for DELETE of a missing entry without the IDC3009I line that real IDCAMS prints.
Where can I practise Return code?
Right here, at ZedBank. You take a junior job at a simulated bank and use Return code in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- Job stepOne program execution within a job. A job is simply a sequence of steps that run in order.
- COND parameterThe older way of telling a job step whether to run, based on the return codes of earlier steps.
- AbendAn abnormal end: a program stopping in an uncontrolled way rather than finishing and reporting a result.
- SDSFThe tool for looking at what jobs are running, what has finished, and what output they produced.
- JobA unit of batch work submitted to the system, made up of one or more steps that run in order.