NET/MASTER Network Control Language (NCL) Programmer's Guide

Sharing Variables to Procedures and Functions
Procedures and Functions
106160 Tandem Computers Incorporated 6–25
Caution The following four settings of the CONTROL verb are equivalent; all prohibit variable sharing:
CONTROL NOSHRVARS
CONTROL NOSHRVARS=NO
CONTROL SHRVARS
CONTROL SHRVARS=NO
Overriding the CONTROL Verb When Calling a Procedure. There are two ways to override
the default setting of the CONTROL verb when you call a procedure. You can
override it by using another CONTROL statement or by explicitly providing a share
list on the CALL statement when you call the procedure.
Note You cannot override the default setting of the CONTROL verb on the procedure declaration of the callee
procedure.
The following code segment shows the first way of overriding the default setting of
the CONTROL statement when calling a procedure:
CONTROL NOSHRVARS /* Default CONTROL setting */
CONTROL SHRVARS (&var_1) /* Overrides CONTROL NOSHRVARS */
CALL control_proc /* Calls CONTROL_PROC */
control_proc: PROCEDURE /* Procedure declaration */
The following example shows the first way in a complete procedure:
zex0614n: PROCEDURE
/* Sharing with the CONTROL verb */
/* Default is CONTROL NOSHRVARS */
&var_1 = One
SAY "Pre-procedure call var_1 is "&var_1
CALL control_proc
SAY "Post-procedure call (NOSHRVARS), var_1 is "&var_1
CONTROL SHRVARS (&var_1)
CALL control_proc
SAY "Post-procedure call (SHRVARS), var_1 is "&var_1
control_proc: PROCEDURE
&var_1 = Two
END control_proc
END zex0614n