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


ERROR statement

z/OS TSO/E CLISTs
SA32-0978-00

Use the ERROR statement to set up an environment that checks for non-zero return codes from commands, subcommands, and CLIST statements in the currently executing CLIST. When an error code is detected, processing continues at the ERROR routine active for the command, subcommand, or CLIST statement that registered the error. If an ERROR routine is not active, the CLIST either terminates or continues, depending on the severity of the error.

The error exit must be protected from being flushed from the input stack by the system. Stack flushing makes the error return codes unavailable. Use the MAIN or NOFLUSH operands of the CONTROL statement to prevent stack flushing.

When ERROR is entered with no operands, the CLIST displays the command, subcommand, or statement in the CLIST that ended in error. No explanatory CLIST ERROR messages are displayed. &LASTCC is reset to 0 and the CLIST continues with the next sequential statement or command.

If the LIST option was requested for the CLIST, the null ERROR statement is ignored.

The ERROR statement must precede any statements that might cause a branch to it.

Read syntax diagramSkip visual syntax diagram
>>-+--------+--ERROR--+--------+-------------------------------><
   '-label:-'         +-OFF----+   
                      '-action-'   

label
A name the CLIST can reference in a GOTO statement to branch to this ERROR statement. label is one-to-31 alphanumeric characters, beginning with an alphabetic character.
OFF | action
OFF
Any action previously set up by an ERROR statement is nullified.
action
Any executable statement, commonly a DO-sequence constituting a routine. The action can execute TSO/E commands, subcommands, and CLIST statements.
Note: Coding ERROR OFF within the DO-sequence routine itself prevents the routine from returning control to the CLIST.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014