NET/MASTER Network Control Language (NCL) Reference Manual

Multiple Variable Assignment Using ASSIGN
Verb Syntax and Variable Access Methods
106126 Tandem Computers Incorporated 11–21
You can assign values that depend on the values of variable start and end values.
Here is an example in which the values of the source, target start, and end values are
variables. In this example, &A20 through &A99 are assigned null values, and
CONTROL NORNGLIM is in effect to accommodate the number of variables in the
range.
ASSIGN VARS=&A* RANGE=(&MIN,&MAX), FROM VARS=&B*,
RANGE=(&BOT,&TOP)
If &MIN = 16, &MAX = 99, &BOT = 1, and &TOP = 4, the results are:
Value of &B1 assigned to &A16
Value of &B2 assigned to &A17
Value of &B3 assigned to &A18
Value of &B4 assigned to &A19
Value of null assigned to &A20
Value of null assigned to &A99
You can use overlapping ranges to shift data values up and down variable ranges.
Here is an example with overlapping ranges:
ASSIGN VARS=&A* RANGE=(2,5) FROM VARS=&A* RANGE=(1,4)
Target
Variables
Source Variables
&A2 = SMITH &A1 = SMITH
&A3 = JONES &A2 = JONES
&A4 = BROWN &A3 = BROWN
&A5 = BLACK &A4 = BLACK
The preceding ASSIGN statement gives the same results as if the following four
assignment statements were the assignment statements executed concurrently:
&A2 = &A1
&A3 = &A2
&A4 = &A3
&A5 = &A4
If you omit both the DATA and FROM keywords, no source data is provided on the
DATA keyword, or no source data exists; the target variables are then set to null. The
following example assigns a null value to &S1 through to the value of &MAXROWS:
ASSIGN VARS=&S* RANGE=(1,&MAXROWS)