Previous Topic: VARTABLE PUT Command—Add or Update a Vartable Entry

Next Topic: VARTABLE RESET Command—Delete Vartable Entries


VARTABLE QUERY Command—Get Vartable Information

The VARTABLE QUERY command obtains information about a memory-resident vartable. You use it to inquire about the existence of a given vartable. If it exists, you can optionally retrieve attribute information.

This command has the following format:

VARTABLE QUERY ID=tablename [SCOPE=scope]
              [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

FIELDS=(fldlist)

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

.AGE

Indicates that you want the AGE option specified on ALLOC returned.

.DATA

Indicates that you want the DATA value specified on ALLOC returned.

.DELOLD

Indicates that you want the DELOLD option specified on ALLOC returned.

.KEYLEN

Indicates that you want the key length of the table returned. If the table was allocated with KEYFMT=NUM, the associated variable is set to NUM.

.LIMIT

Indicates that you want the LIMIT value specified on ALLOC returned.

.TOTAL

Indicates that you want the current number of entries in the table returned.

.USERCORR

Indicates that you want the USERCORR option specified on ALLOC returned.

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.

Example: VARTABLE QUERY

'vartable query id=rxtest scope=region ',
'fields=(keylen,limit,delold) vars=(klen,lmt,dlo)'
say 'kbrexx06_klen=<'||klen||'><'||lmt||'><'||dlo||'>'

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.

16

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