Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
&LASTCC z/OS TSO/E CLISTs SA32-0978-00 |
|
When you use &LASTCC outside an error routine, &LASTCC contains the return code from the last TSO/E command or subcommand, nested CLIST, or CLIST statement executed. Because the value of this variable is updated after the execution of each statement or command, store its value in a symbolic variable before executing code that references the value. In an error routine, &LASTCC is not updated after the execution of each statement or command. Only the RETURN statement updates the value of &LASTCC. If you use &LASTCC in an error routine, &LASTCC contains the return code from the command or statement that was executing when the error occurred. &LASTCC does not support negative return codes. When a negative return code is received from a REXX exec, CLIST converts it to binary, removes the first byte, and stores the remainder in &LASTCC as a positive decimal integer. When &LASTCC receives an error return code from a TSO/E command, subcommand, nested CLIST, or CLIST statement, control passes to an error routine if present in the CLIST. However, when &LASTCC contains the return code from a subprocedure RETURN statement, control does not pass to an error routine. &LASTCC can be used in error routines that handle multiple
error conditions. For example, if an error routine handles arithmetic
errors, it can use &LASTCC to determine what type of message to
display at the terminal:
Note
that &LASTCC itself does not get updated within the error routine.When an error occurs during CLIST I/O processing, use an error
routine to obtain the error code in &LASTCC. For example, to
trap the error code generated by OPENFILE when attempting to open
a file (BADFILE) that does not exist, code the following CLIST:
See Table 1 for a list of the CLIST error codes that &LASTCC can contain. |
Copyright IBM Corporation 1990, 2014
|