NET/MASTER Network Control Language (NCL) Reference Manual

VARTABLE PUT
Verbs
3–212 106126 Tandem Computers Incorporated
Examples
The following example adds an entry to the private (SCOPE=PROCESS) vartable
called MYTABLE. The entry obtains a key value of KEY001 and a data content of
DATA001:
&K = KEY001
&D = DATA001
VARTABLE PUT ID=MYTABLE KEY=&K FIELDS=DATA1 VARS=&D
The following example builds a table containing uniquely identified messages
received in a MSGPROC, the identifier being the first word of the message. The data
for each entry is the last complete message text with that identifier. The counter field
contains the count of messages the identifier received:
VARPUT: PROCEDURE
DO FOREVER
MSGREAD ARGS RANGE(1,1)
VARTABLE PUT ID=IDTABLE SCOPE=REGION,
KEY=&1 ADJUST=1,
FIELDS=DATA1 VARS=&$MSG.TEXT
END
END VARPUT
The preceding example illustrates the ease with which event counting can be
performed. The NCL procedure does not take into account that a particular event (for
example, a message) has already been seen, because the PUT logic handles this. By
specifying SCOPE=REGION, another NCL procedure in the NCL region can
sequentially read the table.