NET/MASTER Network Control Language (NCL) Reference Manual

SYMBOL
Built-in Functions
4–82 106126 Tandem Computers Incorporated
SYMBOL The SYMBOL built-in function tests the supplied name to determine if it can be used
as a valid NCL variable name. Both lowercase and uppercase characters may be used
for the name.
SYMBOL(
name
)
name
specifies the variable to be tested. The variable designator (&) must not be
included in
name
. One of the following values is returned:
VAR
indicates the symbol can be used as a valid variable name.
BAD
indicates the symbol is not valid.
GLBL
indicates the symbol starts with GLBL (indicating a global variable) and is
valid.
Consideration
The attempt to test an illegal or nonexistent system variable name, such as &SYS.RRR,
results in a compilation error.
Examples
In the following example, the name “ABC” is tested and the value VAR is returned,
indicating that the name is a valid NCL variable name:
&A = ABC
&RESULT = SYMBOL(&A)
In the following example, the name “a J” is tested and the value BAD is returned,
indicating that the name is not a valid NCL variable name:
SAY SYMBOL(a J)
In the following example, the name “glbl34f” is tested and the value GLBL is returned,
indicating that the name is a valid NCL global variable name:
SAY SYMBOL(glbl34f)