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

Sharing Variables to Procedures and Functions
Procedures and Functions
6–42 106160 Tandem Computers Incorporated
The following screen shows the results of executing the procedure:
(13:51) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0621N
Pre-procedure call vars are One 1 First Begin
Post-procedure call vars are One 1 First Begin
Post-procedure call vars are Two 2 First Begin
NNM1005 START ZEX0621N PROCESSING COMPLETE. NCLID 001149
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The default is no variable sharing (CONTROL NOSHRVARS) and so no variables are
shared on the first procedure call. The second procedure call overrides the setting of
the CONTROL verb by specifying a list of variables to share, &VAR_1, &VAR_2, and
&VAR_3. Since the CONTROL_PROC procedure specifies the NOSHARE keyword
and a list of variables that are not to be shared on the procedure declaration, the
variables that are shared are &VAR_1 and &VAR_2.
The following table summarizes the interaction between the SHARE keyword on the
second procedure call and the NOSHARE keyword on the procedure declaration:
All Available Variables
Variables Shared by
Second Procedure
Call
Variables Shared by
Control Procedure
Declaration
Result of Variable
Sharing Interaction
&VAR_1 Yes Yes Yes
&VAR_2 Yes Yes Yes
&VAR_3 Yes No No
&VAR_4 No No No
This table shows that, in a finite set of variables (the set is &VAR_1, &VAR_2,
&VAR_3, and &VAR_4), not sharing a subset (&VAR_3 and &VAR_4) is the same as
sharing the remainder (&VAR_1 and &VAR_2).