Return Codes of z/OS Jobs

The z/OS Agent logs all errors that occur in the report (SREP) of the corresponding Job. Depending on how the Job has ended, the Agent also sets a return code.

Notes:

  • You can set the return code that defines that the Job should abort on the Runtime page in the Job object properties.
  • You can define value ranges for the steps instead of individual return codes. The Agent compares the result of a step execution with the defined step list. If you select Completion Code, additional options display where you can specify a return code for each step in the Job.

This is how return z/OS Return Codes are handled when a job ends:

  • The system verifies if the job completed with an abnormal status (ABEND) caused by the system (first) or a user (second). If so, the job is regarded as aborted and the maximum return code is used.

  • If no step list has been defined, the job's return code is checked and used.

  • If a step list has been defined, the return codes of the individual steps are compared to the step list. Only steps whose return codes are not equal to 0 are checked. Return code 0 always signals OK.

  • If a step is included in the step list, it depends on the definition whether the step is OK or not OK. The first step that is not OK considers the job to be aborted. This step's return code is used as the job's return code.

  • If a step is not included in the step list, its return code must be 0. Otherwise, the job is considered as aborted.

For more information, see the Return Code Handling section on the Runtime Page.

z/OS distinguishes between the following types of return codes:

  • Condition Code
    Z/OS: 0 to 4095
    AE: 0000 - 0FFF (0 to 4095)

  • User Abend
    z/OS: U0000 to U4095
    AE: 1000 - 1FFF (4096 to 8191)

  • System Abend
    z/OS: S000 to SFFF
    AE: 2000 - 2FFF (8192 to 12287)

The Agent uses number ranges of 4 KB each to assign the return codes.

Important! The return code of a Job object must be specified as a decimal number. Therefore, you must convert User and System Abends to decimal numbers.

Example

Return code SB37 indicates a full volume while a file is being written. The corresponding decimal number is 11063.

See also: