NET/MASTER Network Control Language (NCL) Reference Manual
VARTABLE ALLOC
Verbs
3–194 106126 Tandem Computers Incorporated
SCOPE=G90PRC is used when NCL processes running in the same Guardian
process need to access a vartable that is not visible to NCL processes running in
other Guardian processes.
A table of the same name may be allocated in each of the five scopes. For example,
an NCL procedure could allocate a table called TAB1 with a scope of PROCESS,
another with a scope of ENV, G90PRC, GLOBAL, or REGION. All statements that
refer to a table with other than the default scope of PROCESS must specify the
SCOPE operand.
For more information on VARTABLE verbs, refer to the NonStop NET/MASTER
NCL Programmer's Guide.
Examples
The following example allocates a private table called MYTABLE with an alphabetic
key length of 20:
VARTABLE ALLOC ID=MYTABLE KEYLEN=20
The following example allocates a global table called GTABLE, visible to all NCL
procedures running in this system. The key length is 30, and update operations
require using the user correlator. A limit of 50 entries is placed on the table:
VARTABLE ALLOC ID=GTABLE SCOPE=GLOBAL,
KEYLEN=30 LIMIT=50 USERCORR=YES
The following example allocates a GLOBAL vartable called GTABLE. The process
then adds two entries in the same vartable and specifies the vartable as a local cached
table. Both the local cached vartable and the global vartable are updated at the same
time. The entry uses a key value of KEY01 and adds two data items of DATA01 and
DATA02; the VARTABLE GET verb is issued to establish a cached copy of the global
vartable named GTABLE in this process. Without VARTABLE GET, only the global
vartable is updated, because a cached copy does not exist; SCOPE=CACHED is
interpreted as SCOPE=GLOBAL.
VARTBL1: PROCEDURE
&K = KEY01
&A = DATA01
&B = DATA02
VARTABLE ALLOC ID=GTABLE SCOPE=GLOBAL KEYLEN=5,
DATA=10 LIMIT=10
VARTABLE GET ID=GTABLE SCOPE=CACHED KEY=&K
VARTABLE ADD ID=MYTABLE SCOPE=CACHED KEY=&K FIELDS=DATA1,
VARS=&D
END VARTBL1