NET/MASTER Network Control Language (NCL) Reference Manual
Multiple Variable Assignment Using ASSIGN
Verb Syntax and Variable Access Methods
106126 Tandem Computers Incorporated 11–19
Multiple Variable
Assignment Using
ASSIGN
This subsection discusses how to use the ASSIGN verb. The main purpose of ASSIGN
is to allow you to manipulate multiple variables in a single operation.
There are four forms of the ASSIGN verb, distinguished by the qualifier that follows
the OPT keyword. This subsection discusses the default form of ASSIGN, in which
OPT=VALUE.
The default form of ASSIGN is used to assign values to multiple variables (the target
variables) from data (the source data) or multiple variables (the source variables).
The target variables and the source variables are specified by the VARS, ARGS,
RANGE, and GENERIC keywords discussed earlier in this section. The assignment
statement, which is used to explicitly assign a single value to a single variable, is
discussed in “Assigning Values to Variables” in Section 9. Additionally, the four
formats of the ASSIGN verb are introduced in Section 3, “Verbs.”
Assigning Source Data to
Target Variables
The simplest use of ASSIGN is to assign the same source data to multiple variables.
You can specify the source data to assign to the target variables by using the DATA
keyword. This keyword specifies a constant. The constant is assigned to all the target
variables. The following examples assign the data “Constant value” to certain sets of
target variables:
ASSIGN VARS=(&A*,&B*) RANGE=(5,10) DATA="Constant value"
The results are:
&A5 = “Constant value”
&A6 = “Constant value”
&A7 = “Constant value”
&A8 = “Constant value”
&A9 = “Constant value”
&A10 = “Constant value”
&B5 = “Constant value”
&B6 = “Constant value”
&B7 = “Constant value”
&B8 = “Constant value”
&B9 = “Constant value”
&B10 = “Constant value”