Allows an NCL procedure to inquire about the existence of a given vartable, and an option to retrieve information when the table is found.
&VARTABLE QUERY ID=tablename
[ SCOPE={ PROCESS | REGION | SYSTEM | AOM } ]
[ FIELDS=fieldlist VARS=varlist ]
Operands:
(Mandatory) Indicates the name of the table about which you want to inquire. The table need not have been previously allocated, as the return codes in &ZFDBK indicate this.
An optional parameter, indicating the scope of the table about which you want to inquire. Allowed values are:
Indicates the table is a private table, visible only to the NCL process that allocated it.
Indicates the table was allocated with a scope of REGION.
Indicates that the table is visible to all NCL procedures executing in the same system.
Indicates that this statement refers to a mirrored VARTABLE. Extra information is returned for SCOPE=AOM vartables.
Note: SCOPE=AOM is available only if your region includes Automation Services products.
These optional parameters let you specify the information you want to retrieve about a table, and the NCL variables where the information is located. Specify both these parameters, or omit both. If specified, the two parameters must have the same number of entries within their lists.
FIELDS=fieldlist nominates the information you want returned. fieldlist is a list of names in the format:
name
(name)
(name,name,...)
where each name is one of the following (you cannot duplicate any of these names in the list):
Indicates that you want the AGE option specified on ALLOC returned.
Indicates that you want the DATA value specified on ALLOC returned.
Indicates that you want the DELOLD option specified on ALLOC returned.
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.
Indicates that you want the LIMIT value specified on ALLOC returned.
Indicates that you want the current number of entries in the table returned.
Indicates that you want the USERCORR option specified on ALLOC returned.
AOM tables can have the following additional field names specified:
Indicates the total number of matches that have been counted by screening table LOOKUP statements with the TOTAL option specified.
Indicates the total number of no-matches that have been counted by screening table LOOKUP statements with the TOTAL option specified.
Indicates the total number of ADDs that have been counted by screening table LOOKUP statements with the ADD and TOTAL option specified.
VARS=varlist nominates the NCL variables that receive the information for each entry in fieldlist. A one-to-one correspondence exists from each entry in varlist to the same entry in fieldlist. Thus the first entry in varlist nominates the variable that receives the data for the first entry in fieldlist, and so on. varlist must be in one of the following formats:
varname
(varname)
(varname,varname,...)
where varname is a valid NCL variable name, without the ampersand (&), unless you want to refer to the variable containing the data indirectly.
Examples: &VARTABLE QUERY
&VARTABLE QUERY ID=MYTABLE
This example queries the existence of a table named MYTABLE, in the current NCL process environment. &ZFDBK is set as a result.
&VARTABLE QUERY ID=RTABLE FIELDS=(.TOTAL,.KEYLEN) VARS=(T,K)
This example queries the existence of a table named RTABLE. If found, the key length and current number of entries are returned in NCL variables T, and K, respectively.
Return Codes:
System variable &ZFDBK is set after an &VARTABLE QUERY statement to indicate the result of the operation:
A table with the supplied name was found in the requested scope. Information variables are set if requested.
No table of this name exists in this scope.
Notes;
Syntax errors in a &VARTABLE QUERY statement terminates the NCL procedure.
Always specify SCOPE=REGION to refer to a table of that scope.
| Copyright © 2009 CA. All rights reserved. |
|