Use the RETURN statement to:
- Return control from an error routine or an attention routine to
the statement following the one that ended in error or the one that
was interrupted by an attention.
- Provide a return code from a subprocedure. Control will pass
to the statement following the SYSCALL statement that called the subprocedure.
The return code is stored in the control variable &LASTCC (Note,
however, that return codes from CLIST subprocedures do not cause
an error routine to receive control.)
RETURN is valid only when issued from a subprocedure, an activated
error routine, or an activated attention routine. If issued from
any other place, RETURN is treated as a no-operation.
>>-+--------+--RETURN--+------------------------+--------------><
'-label:-' '-CODE(-+------------+-)-'
'-expression-'
- label
- A name the CLIST can reference in a GOTO statement to branch
to this RETURN statement. label is one-to-31 alphanumeric
characters, beginning with an alphabetic character.
- CODE
- Subprocedures can issue a return code. Control will pass to
the statement following the SYSCALL statement that called the subprocedure.
- expression
- A CLIST-defined return code. expression can be a character
string, a decimal integer, or an expression that evaluates to a decimal
integer. The expression is stored in the control variable &LASTCC.
If CODE appears without an expression, &LASTCC takes a null value.