Previous Topic: JCL Error Status: Which Side?Next Topic: Child Processes and Return Codes


Exitcode (Return Code) Processing

For agent jobs, the agent, not CA WA CA 7 Edition, determines the success or failure of the job. Some job types let you code one or more EXITCODE statements to specify what return codes that the agent treats as success or failure.

By default, an exit code of 0 (zero) indicates job success, and any other code indicates job failure.

You can use the EXITCODE statement to define a single exit code or a range of exit codes as either success or failure. If you specify multiple exit codes, enter the most specific codes first followed by the ranges.

The following are some examples.

Example 1:

Exit codes 0, 2, 4 indicate success.

All others indicate failure.

EXITCODE 0 SUCCESS
EXITCODE 2 SUCCESS
EXITCODE 4 SUCCESS

Example 2:

Exit codes in the range 0 through 100 indicate success.

Exit code 19 and exit codes in the range 101-200 indicate failure.

Exit codes in the range 201 through 300 indicate success.

All other exit codes indicate failure

EXITCODE 19 FAILURE
EXITCODE 0-100 SUCCESS
EXITCODE 101-200 FAILURE
EXITCODE 201-300 SUCCESS

Example 3:

Exit codes 0, 1 indicate failure.

Exit codes 2 and above indicate success.

EXITCODE 0-1 FAILURE
EXITCODE 2- SUCCESS