NET/MASTER Network Control Language (NCL) Reference Manual
VARTABLE GET
Verbs
3–206 106126 Tandem Computers Incorporated
When the VARTABLE GET verb is issued with SCOPE=GLOBAL for a global
vartable for which a local cache copy exists, all such copies are deleted in all
operating system processes; this allows an application to remove the cache during
periods of heavy updating.
SCOPE=CACHED and AGE=YES are incompatible and result in a compilation error.
You must use AGE=NO with SCOPE=CACHED.
See also VARTABLE ALLOC, which sets the correlation protection option.
For more information on VARTABLE verbs, refer to the NonStop NET/MASTER
NCL Programmer's Guide.
Examples
The following example retrieves the entry from the private (SCOPE=PROCESS)
vartable called MYTABLE. The user data in that entry is returned in field &D:
&K=KEY001
VARTABLE GET ID=MYTABLE KEY=&K FIELDS=DATA VARS=&D
WRITE DATA FOR KEY &K IS &D
The following example illustrates a technique to read sequentially through a table.
The first VARTABLE GET, using OPT=FIRST, retrieves the entry with the lowest key,
and the key value is returned in &K. The second VARTABLE GET, using OPT=KGT,
retrieves the entry with the next-higher key, and sets that key value in &K:
VARTABLE GET ID=GTABLE SCOPE=GLOBAL OPT=FIRST,
FIELDS=(KEY,DATA) VARS=(&K,&D)
VARTABLE GET ID=GTABLE SCOPE=GLOBAL OPT=KGT KEY=&K,
FIELDS=(KEY,DATA) VARS=(&K,&D)
In the previous example, backward retrieval can be achieved by using OPT=LAST and
OPT=KLT.