RETURN

Restriction: This topic applies to Windows environments only.

[label] RETURN (lit1,lit2)

,[T]

,RC=n|(n)

Parameters

(lit1,lit2)
T
Causes the control program to flag the save area used by the calling program.
RC=n
Sets the return code to the numeric value specified by n.
RC=(n)
Numeric values from 0 through 15 that specify the from and to registers to restore from the register save area. This area is normally pointed to by register 13.

Comments

Sets the return code to the numeric value in register n.

Restores the specified registers and returns to the calling program.

lit1 is the first register to restore. lit2 is the last register to restore. lit1 and lit2 must be values between 0 and 15. If lit1 is greater than lit2 then the registers saved are lit1 through 15 and 0 through lit2. However, register 15 is never restored, because it is always used to hold the return code.

If the calling program is in Assembler the return code is available in register 15. If the calling program is in COBOL, the return code is available in RETURN-CODE.

Examples

Example 1

RETURN (14,12)

Restores the contents of registers 14 and 0 through 12 from the register save area specified in register 13.

Example 2

RETURN (14,12),,RC=0

Restores the contents of registers 14 and 0 through12 and sets the return code (and hence register 15) to zero.

Example 3

RETURN (14,12),,RC=(15)

Restores the contents of register 14 and 0 through 12 and sets the return code to the current value of register 15.