NET/MASTER Network Control Language (NCL) Reference Manual

Variable Lists Beginning With VARS
Verb Syntax and Variable Access Methods
106126 Tandem Computers Incorporated 11–17
Here is an example of a function that generates a list of names that can be used as part
of a VARS list.
MSGREAD VARS=(GET_NAMES())
GET_NAMES: FUNCTION
/* This function generates a list of symbols that are put */
/* in the VARS list. The value of &RESULT after the */
/* function is: */
/* NAME1 VALUE1 … NAME50 VALUE50 */
/* The final MSGREAD statement is: */
/* MSGREAD VARS=((NAME1 VALUE1 … NAME50 VALUE50)) */
/* This MSGREAD statement is equivalent to: */
/* MSGREAD VARS=(&NAME1,&VALUE1,…,&NAME50,&VALUE50) */
DO &I = 1 TO 50
&RESULT = &RESULT NAME||&I VALUE||&I
END
RETURN (&RESULT)
END GET_NAMES
Specifying Generic
Variables
A generic variable specification consists of an optional variable name followed by an
asterisk and the GENERIC keyword.
Here are the components of the VARS list that you use to specify a generic variable
specification:
&[
variable
] *
and
GENERIC
You can precede the asterisk (*) by blanks because NCL treats it as a separate lexical
element. Spaces are permitted after the ampersand (&) if the variable name is null.
The variable name specification must be valid.
NCL regards the asterisk (*) that follows
variable
as a wildcard in this context. It
refers to all variables that have names beginning with &
variable
. For example, the
generic variable name &a* includes &a, &a1, &ab, and so on.
If you want to access global variables, you can do so only by having a variable name
that starts with GLBL. (This is permitted only on operations that permit the use of
global variables. An example to the contrary is SHARE.) If you use a variable name of
G, for example, you do not access global variables, only the current local variables
beginning with G.
It is illegal to access system variables generically by using a variable name that begins
with the SYS. stem. You access system variables individually.