NET/MASTER Network Control Language (NCL) Reference Manual
VARTABLE UPDATE
Verbs
106126 Tandem Computers Incorporated 3–223
Examples
The following example updates an entry in the private (SCOPE=PROCESS)
VARTABLE called MYTABLE. The entry obtains a key value of KEY001 and updates
its three data fields with a data content of DATA001, DATA002, and DATA003. The
counter is increased by 1:
&K = KEY001
&D1 = DATA001
&D2 = DATA002
&D3 = DATA003
VARTABLE UPDATE ID=MYTABLE KEY=&K FIELDS=DATA*,
VARS=&D* ADJUST=1
The following example updates a table containing previously supplied uniquely
identified messages received in a MSGPROC, the identifier being the first word. The
data for each entry is the last complete message text with that identifier. The counter
field contains the count of messages that that identifier received:
VAREVER: PROCEDURE
DO FOREVER
MSGREAD ARGS RANGE(1,1)
VARTABLE UPDATE ID=IDTABLE SCOPE=REGION,
KEY=&1 ADJUST=1,
FIELDS=DATA1 VARS=&$MSG.TEXT
END
END VAREVER
In the preceding example, only message identifiers that have been previously entered
into the table have their occurrences counted. If an entry is not found, the &SYS.FDBK
system variable is set to 8, and the update is not performed. By specifying
SCOPE=REGION, another NCL procedure in the NCL region can sequentially read the
table. Contrast the previous example with the example under VARTABLE PUT.