Using the Return command to pass control

The Return (RETURN) command in a CL procedure or original program model (OPM) program removes that procedure or OPM program from the call stack.

If the procedure containing the RETURN command was called by a Call Bound Procedure (CALLPRC) command, control is returned to the next sequential statement after that CALLPRC command in the calling program.

If a Monitor Message (MONMSG) command specifies an action that ends with a RETURN command, control is returned to the next sequential statement after the statement that called the procedure or program containing the MONMSG command.

The RETURN command has no parameters.

Note: If you have a RETURN command in an initial program, the command entry display is shown. You may want to avoid this for security reasons.