NET/MASTER Network Control Language (NCL) Programmer's Guide
Sharing Variables to Procedures and Functions
Procedures and Functions
106160 Tandem Computers Incorporated 6–27
The following example shows the second way in a complete procedure:
zex0624n: PROCEDURE
/* Sharing with the CALL statement */
/* 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
CALL control_proc SHARE &var_1
SAY "Post-procedure call (CALL SHARE), var_1 is "&var_1
control_proc: PROCEDURE
&var_1 = Two
END control_proc
END zex0624n
The following screen shows the results of executing the procedure:
(08:08) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0624N
Pre-procedure call var_1 is One
Post-procedure call (NOSHRVARS), var_1 is One
Post-procedure call (CALL SHARE), var_1 is Two
NNM1005 START ZEX0624N PROCESSING COMPLETE. NCLID 000082
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
When the CONTROL_PROC procedure is called for the first time, the default setting
of CONTROL NOSHRVARS prevents variables being shared to CONTROL_PROC.
Accordingly, the value of &VAR_1 does not change. When the CONTROL_PROC
procedure is called for the second time, the CALL statement enables variable sharing,
and so the value of &VAR_1 is changed.