ICETOOL sets a return code for each operator it runs and then sets the step return code to the highest of those. So if one operator returns 4 and another returns 16, the step return code is 16. You can use this in JCL to conditionally run later steps (e.g. only if return code is 0). The MODE operator controls what ICETOOL does when an operator fails: STOP (stop processing), CONTINUE (run the next operator anyway), or SCAN. This page explains the common return codes and how to use MODE for error handling.
ICETOOL runs each operator in order. Each operator (COPY, SORT, COUNT, etc.) returns a return code. ICETOOL keeps the maximum return code and sets the step return code to that value. So one failure (e.g. 16) makes the whole step fail even if earlier or later operators succeeded (0 or 4).
| Return code | Meaning |
|---|---|
| 0 | Success; no errors. |
| 4 | Success with DFSORT warning (e.g. truncation, warning condition). |
| 8 | Unsuccessful; e.g. COUNT operator found criteria met when RC8 was specified. |
| 12 | Unsuccessful; ICETOOL or DFSORT error, or COUNT criteria met when RC12. |
| 16 | DFSORT detected one or more errors during the operation. Check DFSMSG. |
| 20 | Message dataset error: TOOLMSG missing or not opened. |
| 24 | Unsupported operating system. |
MODE controls behavior when an operator returns a non-zero return code:
123COUNT FROM(INDD) USING(CTL1) MODE CONTINUE SORT FROM(INDD) TO(OUTDD) USING(CTL2)
Here if COUNT fails, ICETOOL still runs SORT. The step return code is the higher of the two operators’ return codes.
You can use the step return code in conditional execution. For example run a backup step only if ICETOOL succeeded (RC 0 or 4), or run an error-handling step only if RC > 4. Syntax is site-dependent (COND on EXEC, or IF/THEN/ELSE in JCL).
Imagine you have a list of three chores. Each chore can end with “done” (0), “done but with a small warning” (4), or “failed” (16). The step’s overall result is the worst outcome: if any chore failed, the whole step is “failed.” MODE STOP means “stop doing chores as soon as one fails.” MODE CONTINUE means “try all three chores no matter what; at the end we’ll still say the step failed if any chore failed.”
1. What does ICETOOL set as the step return code when multiple operators run?
2. What does MODE CONTINUE do?
3. Return code 20 from ICETOOL usually indicates what?
4. When would you use MODE STOP (default)?
5. What does return code 16 indicate?