NET/MASTER Network Control Language (NCL) Reference Manual

Assigning Values to Variables
Variables
9–18 106126 Tandem Computers Incorporated
Parameters are positional. If passed, &1 is the first parameter created to hold the first
parameter passed to an NCL procedure when it is called, &2 is second, &3 is third, and
so on. This means that parameters must be passed to an NCL procedure in the order
in which the procedure expects to receive them.
A parameter count is kept in the system variable &SYS.PARMCNT. If a procedure is
invoked by the START or EXEC command and parameters are passed to it, the
complete parameter string is available in the system variable &SYS.ALLPARMS.
Assigning Values to
Variables
You can use the assignment core statement to explicitly assign a single value to a
single variable. The syntax of the assignment core statement is:
variable
=
expression
If
variable
contains more than one ampersand, NCL uses variable substitution to
determine the final form of the variable name before assignment. The following table
lists examples of variable assignment:
What You Type Meaning
&A = &B Assigns the value of &B on the right side of the equal sign (=) to the
variable &A on the left side of the equal sign (=).
&a = &a + 1 Assigns the value of (&a + 1) to &a.
&A = 10 Assigns the value of 10 to &A.
&abc = 123 + 456 Assigns the value of 579 to &abc.
&TOTAL. = 0 Assigns the initial value of 0 to every compound variable with the
stem of &TOTAL.
&month = january Assigns the value of “january” to &month.
&&Z = &SYS.USER.ID After complex variable name substitution, assigns the value of
&SYS.USER.ID to the final form of the variable name on the left
side of the equal sign (=).
&TEXT = &$EMS.TEXT Assigns the value of &$EMS.TEXT to &TEXT.
&a = Assigns a null value to &a.
The ASSIGN verb is used to manipulate and assign values to multiple variables.
Using keywords is a major topic of Section 11, “Verb Syntax and Variable Access
Methods.” The ASSIGN verb is introduced in Section 3, “Verbs,” and is discussed in
Section 11. See also the assignment core statement in Section 2, “Core Statements.”