The &EXIT verb terminates the current nesting level to resume processing at a higher level. Optionally, a return code is passed back to the higher nesting level, and becomes available in the &RETCODE system variable.
This verb has the following format:
&EXIT [ return code ]
Operands:
This is a numeric value from 0 to 99. If specified, this value becomes available in the &RETCODE system variable for testing by a higher nesting level (if one exists).
Examples: &EXIT
&WRITE ALARM=YES DATA=ENTER LU NAME &PAUSE ARGS &IF .&1 = . &THEN + &EXIT 4 . . .
On return to a higher nesting level, the procedure can test the return code, for example:
&IF &RETCODE = 4 &THEN + &WRITE ALARM=YES DATA=LU NAME OMITTED
Notes:
If the return code is not specified on an &EXIT statement, then any value set previously in another procedure level remains intact and becomes available across multiple nesting levels.
The &RETURN statement is used to return to a higher nesting level, passing any specified variables.
The &CONTROL SHRVARS statement is used to share variables between nested procedure levels.
| Copyright © 2009 CA. All rights reserved. |
|