Previous Topic: &ENCODE

Next Topic: &ENDAFTER


&END

&END 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.

&END [ return code ]

Operands:

return code

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: &END

&WRITE ALARM=YES DATA=ENTER LU NAME
&PAUSE ARGS
&IF .&1 = .  &THEN +
   &END 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 &END 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.

More information:

&RETCODE

&CONTROL

&RETCODE

&RETURN

&EXIT