The CALLPRC command calls a procedure named on the command, and passes control to it. The CALLPRC command has the following format:
CALLPRC Procedure(procedure-name) PARM(parameter-values) RTNVAL(return-value-variable)
The procedure name may not be a variable. The PARM parameter is
discussed under Passing Parameters between Programs and Procedures. When the called procedure finishes running, control
returns to the next command in the calling procedure.
The sequence of CALLPRC commands in a set of procedures calling each other
is the call stack. For example, in this series:
the call stack is:
When PROGC finishes processing, control returns to PROGB at the command after the call to PROGC. Control is thus returned up the call stack. This occurs whether or not PROGC ends with a RETURN or an ENDPGM command.
A CL procedure can call itself.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.