when this line is executed, the EXEC issues a read to your virtual
machine so thatyou can enter up to 30 arguments, to be assigned to the
variables &1, &2, and soon. ASSIGNMENT STATEMENTS User-defined variable names begin with an ampersand (&) and contain up
to seven additional characters,. These variables can contain numeric or
alphameric data.You define and initialize EXEC variables in assignment
statements. In an assignment statement, the first data item starts with
an ampersand (&) and the second data item is an equal sign (=). The
value of the expression on the right side of the equal sign is assigned
to the variable named on the left of the equal sign. For example:
&A = 35
is an assignment statement that assigns the numeric value 35 to the
variable symbol &A. A subsequent assignment statement might be:
&B = &A +10 After this assignment statement executes, the value of &B would be 35
plus10, or 45. You can use the &READ control statement to assign variable names
interactively. For example, when the statement:
&READVARS &NAME &AGE
is executed, theEXEC issues a read to your virtual machine, and you can
enter a line of data. The firsttwo words, or tokens, you enter are
assigned to the variable symbols&NAME and &AGE, respectively. !gte: The data item immediately following the target of an assignment
statement must be an equal sign (=) and not anEXEC variable that has
the value of an equalsign. Conversely, if an equal sign is to be the
first data item following anEXEC control word, then it must be
specified as anEXEC variable that has the value of an equal sign and
not as an equal sign; otherwise, the statement is interpreted as an
assignment statement and the control word is thereafter treated as a
variable.
If you use a variablename that has not been defined, the variable
symbol is set to a null stringby the EXEC processor when the statement
is executed. For example, ifyou have entered only two arguments on the EXEC command line, then the statement:
&IF &3 EQCONT &ERROR &CONTINUE is interpreted:
&IF EQCONT &ERROR &CONTINUE &ERROR and &CONTINUE are recognized by EXEC as control statements.
Since &3 is undefined, however, it1S replaced by blanks and the
resulting line produces an error duringEXEC processing. You can
prevent the error, and allow for null arguments or variables, by102 IBM VM/370 eMS User's Guide
machine so that
variables &1, &2, and so
to seven additional characters,. These variables can contain numeric or
alphameric data.
statements. In an assignment statement, the first data item starts with
an ampersand (&) and the second data item is an equal sign (=). The
value of the expression on the right side of the equal sign is assigned
to the variable named on the left of the equal sign. For example:
&A = 35
is an assignment statement that assigns the numeric value 35 to the
variable symbol &A. A subsequent assignment statement might be:
&B = &A +
plus
interactively. For example, when the statement:
&READ
is executed, the
enter a line of data. The first
assigned to the variable symbols
statement must be an equal sign (=) and not an
the value of an equal
first data item following an
specified as an
not as an equal sign; otherwise, the statement is interpreted as an
assignment statement and the control word is thereafter treated as a
variable.
If you use a variable
symbol is set to a null string
is executed. For example, if
&IF &3 EQ
&IF EQ
Since &3 is undefined, however, it
resulting line produces an error during
prevent the error, and allow for null arguments or variables, by