Previous Topic: Send a Program's Return CodeNext Topic: Specify Data for a Local Data Area


Send a User-Defined Exit Code

By default, an exit code of zero (0) is interpreted as job success and any other number indicates job failure. However, you can map exit codes other than 0 as job success.

To send a user-defined exit code, specify the EXITCODE statement in the job definition.

Example: Send Exit Code 100 as Success

This example runs the PAYPROG program. The program is considered to have completed successfully if it returns an exit code of 0 or 100.

AGENT I5AG
CLPNAME PAYPROG
EXITCODE 100 SUCCESS
EXITCODE 0 SUCCESS

Example: Send Exit Code 40 as Failure

This example runs the RECPROG program. The program is considered to have failed if it returns an exit code of 40. All other exit codes in the range from 0 to 255 indicate job success.

AGENT I5AG
CLPNAME RECPROG
CCEXIT *PROGRAM
EXITCODE 40 FAILURE
EXITCODE 0-255 SUCCESS