The command which may be used to call a procedure is specified in the procedure head, in the CALLER operand of the SET-PROCEDURE-OPTIONS command. If CALLER = *CALL is specified, the procedure may only be called by a CALL-PROCEDURE (similarly, for CALLER = *INCLUDE only by an INCLUDE-PROCEDURE). Only if CALLER = *ANY is specified may the procedure optionally be called by CALL-PROCEDURE or INCLUDE-PROCEDURE.
CALL-PROCEDURE and INCLUDE-PROCEDURE have exactly the same operands. However, they differ in their effect on the visibility of variables when the procedure is called from within another procedure. In procedures called with INCLUDE-PROCEDURE, unless otherwise specified, all variables are visible that are also visible in the calling procedure. In procedures that are called with CALL-PROCEDURE, unless otherwise specified, only variables local to the procedure are visible in the current procedure. (For more information, see section “Scope of variables”.)
Thus, the selection of a call command depends on whether the variable environment of the called procedure is to be retained.
Any procedure call must first name the procedure container. The caller can then define how the procedure is to be logged, whether a program loaded at execution time can be unloaded and whether the procedure is to be executed immediately in its entirety or should be interrupted for testing. The caller can also pass procedure parameters in the procedure call.
All these attributes are controlled by the operands of the procedure call commands, as described below. There is a special feature in the case of logging, which can also be set when the procedure is called; however, whether logging is performed and what is logged also depends on the settings that are valid within the procedure during its execution.