EXEC Control statements-Assignment Statement
The Assignment Statement Use the assignment statement in an EXEC procedure to assign a value to a
variable symbol. Variable symbols may be tested and manipulated to
control the execution of an EXEC procedure. The format of the
assignment statement is:
r , I I I L- &variable
&variable
string
ae
fu nct ion X'xxxxxx I string
ae
function X'xxxxxx } 1 , I 1 I indicates the variable symbol which is assigned the
specified value. A variable may contain a maximum of eight
alphameric and national charactersr including the initial
ampersand, which is required. Except in the EXEC special
variables &* and &DISK*r a variable must not contain any
special characters.
is a data item of up to eight characters. It may also be a
variable symbol or null. Whether a numeric string is
treated as numeric or character data depends on how it is
used in the EXEC. If a string containing variable symbols
expands to more than eight charactersr it is truncated. If
the string consists of eight X'FF' characters r the variable
is set to a null string.
is an arithmetic expression consisting of a sequence of data
items that possess positive or negative integral values and
are separated by plus or minus signs:
&1 - 4 + &CALC - 6
is an built-in function followed by at least one token.
indicates up to six hexadecimal digits to be converted to
decimal before assignment. For example: &A = X'CO results in &A having the decimal value 192.
Hexadecimal conversion is not performed unless you have used
the &HEX ON control statement.
All variable symbols occurring in executable statements are substituted
before the statement is executed. An executable statement is (1) a eMS command liner or (2) an EXEC control statement (including assignment
statements) .
278 VM/370 CMS Command and Macro R2ference
EXEC Control Statements-Assignment Statement, &ARGS sUbstitution is performed on all symbols on the left-hand
side of an assignment statement, except the leftmost variable. For
example: &1 = 2 &X&1 = 5
sets &X2 to 5.
If a variable on the left-hand side of an assignment statement has
already been assiqned a value, it is replaced by the new value specified
in the statement.
If the special form, X'&symbol, is converted to its hexadecimal equivalent.
&A = 192 STIPE X'&A results in the display:
co
used, the specified symbol
For example:
is
If a variable symbol that has not been defined is used in an
executable statement the symbol is set to a null token and ignored. In
some instances this may cause an EXEC processing error.
All exe=crtable statements in an EXEC are scanned into eight-character
tokens, and padded or truncated as necessary_ Tokens are formed of words
delimited by blanks and parentheses. If there is no blank before or after a parenthesis, one is added in either If more than one
blank separates a word or a parenthesis from another, the extra blanks
are from the line. For example, the line: STIPE THIS IS AN EXAGGERATED (MESSAGE scans as: &TIPE THIS IS AN EXAGGERA ( MESSAGE symbols are substituted after each line is scanned. and each is scanned repeatedly until all symbols in it are substituted.
In an executable statement, a token beginning with the character X' FF' a v ar iable to which such a token is assigned as a value)
usually prevents the processing of data following it on tne same line. However, if an assignment statement sets a variable to eight X'FF' characters, data following the variable in an executable statement is
processed. &ARGS Use the &ARGS control statement to redefine the value of one or more of
the spe=ial variables, &1 through &30. The format of the &AR3S control
statement is:
r I &ARGS [arg1 [arg2 ••• [arg30] ] ] '-- Section 5. EXEC Control Statements 279
Previous Page Next Page