The system applies the return code tests on the IF/THEN/ELSE/ENDIF
statement construct to the return code, if any, produced by a job,
step, or procedure step in the job. To take advantage of this
statement construct, the return codes for each step should have
compatible meanings. For example, the COBOL compiler and the linkage
editor have compatible return codes:
- 4
- Minor errors were found, but a compiled program or load module
was produced. Execution may be successful.
- 8
- Major errors were found, but a compiled program or load module
was produced. Execution will probably not be successful.
- 12
- Serious errors were found. A compiled program or load module
was not produced.
To continue processing in spite of small errors, code the return
code test as follows:
//NOTBAD IF (RC > 4) THEN
//BADERR EXEC PGM=ERRRTN
//NOGOOD ELSE
//NEXTSTEP EXEC
// ENDIF
When a previous job step has a return code greater than 4, step
BADERR executes an error routine procedure called ERRRTN. When the
return code on all previous job steps is less than or equal to 4,
the ELSE statement allows processing to continue with step NEXTSTEP.