Previous Topic: VARTABLE RESET Command—Delete Vartable Entries

Next Topic: WRITE


VARTABLE UPDATE Command—Update a Vartable Entry

The VARTABLE UPDATE command updates an entry in an existing memory-resident vartable. The update operation can occur concurrently with vartable updating in other processes. If you want to delete or update a vartable entry, use a correlator to synchronize any accesses to the entry.

This command has the following format:

VARTABLE UPDATE ID=tablename [SCOPE=scope] KEY=key 
               [ADJUST=a | COUNTER=c]
               [FIELDS=(fldlist) VARS=(varlist)]
ID=tablename

Specifies the name of the table.

Characters: A through Z, a through z, 0 through 9, #, $, and @

Limits: 1 through 12 characters

SCOPE={SYSTEM | PROCESS | REGION}

Specifies the scope of the vartable.

Default: PROCESS

KEY=key

Specifies the key for this table entry.

If the table is allocated with KEYFMT=CHAR and the key is shorter than the declared key length, the supplied key value is padded with blanks. If the key is longer, a return code of 12 is set in RC and no action is taken on the entry. If the key contains spaces, enclose the key between quotes, for example:

ThisKey = Feature||' '||Version||' '||PrdId
"VARTABLE …",
"       KEY='"||ThisKey||"'",
…
"VARTABLE …",
"       KEY='TPCF 99.99.99 MMGR-SQJ'",
…

If the table was allocated with KEYFMT=NUM, the key value must be a valid, signed number.

ADJUST=a

Specifies the value by which to increase or decrease the counter.

COUNTER=c

Specifies the value of the counter field.

FIELDS=(fldlist)

Specifies the fields in the format fname[,…fname]. fname must be one of the following mutually exclusive values:

DATAn

Indicates that you are operating on a data value for the nth data field in this entry. n must be from 1 to the value specified on the DATA= parameter when the table was allocated. You can have several DATAn entries, as long as each has a unique number n.

DATA*

Indicates that you are operating on the data for all the data fields in this entry, from 1 to the value specified on the DATA= parameter when the table was allocated. The accompanying variable name in the VARS= list must be in the format prefix*, and the suffixes generated to access the variables are 1 to the number of allocated data fields.

.COUNTER

Indicates that you are supplying an initial value for the counter field in this entry.

.ADJUST

Indicates that you are supplying an adjustment value for the counter field in this entry.

.USERCORR

Indicates that you are supplying a user correlator check value. Because a new entry cannot have a value to check against, the supplied value is ignored (but must be numeric).

VARS=(varlist)

Specifies a list of valid REXX variables that holds values assigned to fldlist. A one-to-one correspondence exists between each entry in varlist to the same entry in fldlist. For example, the first entry in varlist specifies the variable containing the data for the first entry in fldlist. If fldlist includes DATA*, the associated varlist entry must be in the format prefix*. When values are returned, they are in variables prefix1 through prefixn.

Example: VARTABLE UPDATE

'vartable update id=rxtest key=secnd scope=region ',
'fields=(data1,data2,data3) vars=(dt11,dt12,dt13) ',
'adjust=15'

Return Codes

The codes returned are the same as the &ZFDBK values as documented for the NCL &VARTABLE verb.

The return codes are as follows:

0

Indicates that the request was satisfied.

4

Indicates that no entry with the requested key value exists.

8

Indicates that an entry with the supplied key value exists, but the supplied user correlator value did not match the user correlator value in that entry.

12

Indicates that the supplied key value was longer than the table key length.

16

Indicates that no table of this name exists in this scope.

20

Indicates that the table was allocated with USERCORR=YES specified, and no user correlator was supplied.

24

Indicates that the table is already at the limit specified by VARTABLE ALLOC. The entry could not be added.