z/OS TSO/E Customization
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Exit reason code

z/OS TSO/E Customization
SA32-0976-00

Use the exit reason code parameter to return an exit reason code to the function or command processor.

If an exit sets a return code of 12, the command processor or function displays an error message to the user and then terminates processing. The error message indicates that the exit requested termination of the command or function. The message also contains an exit reason code. If the exit does not return an exit reason code, the command processor or function specifies a reason code of 0 in the error message. If the exit returns an exit reason code, the error message specifies the reason code that the exit returned. By using return code 12 and different exit reason codes, you can determine why a particular exit requested termination of a function or command.

To return an exit reason code, the exit must update the key and data fields for the exit reason code (parameter entry 7) as follows:
Key
X'01'
Data
the value of the exit reason code

For certain exits, you can request that the invoking program use the exit reason code as its return code by using a key of X'03'. Only some exits support a key of X'03'. The individual descriptions of each exit in this document describe whether you can use a key of X'03'.

To have the function or command processor use the exit reason code as its return code, the exit must update the key and data fields for the exit reason code (parameter entry 7) as follows:
Key
X'03'
Data
the value of the exit reason code

If you write several exits for a command and more than one exit indicates that the command should use the exit reason code as its return code, the command processor uses the reason code from the last exit it invokes. For example, suppose you write an initialization and a termination exit for the EXEC command. If both exits request that the exit reason code is used as the return code from EXEC, the EXEC command processor uses the reason code from the termination exit.

You must ensure that the exit reason code you want to use as a command's return code is not the same as an existing return code for the command processor. For a list of the TSO/E return codes for each command, see .

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014