NET/MASTER Network Control Language (NCL) Reference Manual

Variable Name Substitution
Variables
9–12 106126 Tandem Computers Incorporated
2) The content of the substitution buffer is validated as a valid simple
variable name and is converted to uppercase.
b. If this segment is empty, the content of the substitution buffer is validated as a
valid simple variable name and converted to uppercase.
Note The substitution buffer holds the variable name being constructed during substitution processing.
Note also that NCL uppercases all user-specified variable names during compilation.
The following table illustrates the mechanics of complex variable substitution on the
example variable &A&&B&1C&2D. (For the values given in the table,
&A&&B&1C&2D evaluates to &AW).
Step Operation Result
1b. Place “D” into substitution buffer. D
1c. Look up “2.” For example, &2 has a value of z
1d. Prefix value into substitution buffer. zD
2a1). Prefix “C” into substitution buffer. CzD
2a2). Look up “1.” For example, &1 has a value of y
2a3). Prefix value into substitution buffer. yCzD
3. Get next segment.
2b1). Prefix “B” into substitution buffer. ByCzD
2b2). Validate content of substitution buffer as a
simple name.
BYCZD
2b3). Look up substitution buffer. For example, &BYCZD has a value of x
2b4). Place value into substitution buffer. x
3. Get next segment.
2c1). Validate content of substitution buffer as a
simple name.
X
2c2). Look up substitution buffer. For example, &X has a value of w
2c3). Place value into substitution buffer. w
4a1). Prefix “A” into substitution buffer. Aw
4a2). Validate substitution buffer as a simple name. AW
During processing, the content of the substitution buffer cannot exceed 250 characters.
The length of the final form of the variable name cannot exceed 250 characters.
When a complex variable is used as the target of an assignment, the last name derived
is used as the destination variable name. The last reference to access the value of the
variable (representing the leading ampersand) is not performed.