Pathmaker Reference Manual

Macro Definition and Commands
Macro Language
3–6 067869 Tandem Computers Incorporated
SET Use the SET command to create local and global variables.
% SET
variable-name variable-value
variable-name
is a local or global variable to be assigned a value.
variable-value
can be either of the following:
text string
is any text, up to 232 characters. A text string can itself contain a variable. If
variable-value
contains another variable, the system performs nested
substitutions prior to setting the value of
variable-name
.
arithmetic expression
is a legal arithmetic expression that includes terms which can be variables or
decimal numbers and uses standard operators (+, -, *, /) and balanced
parentheses. Arithmetic operations follow standard precedence: unary - has
precedence over * and /. * and / have precedence over + and -. Operators of
like precedence are evaluated left to right unless parentheses are used to
dictate the order of evaluation (as in the third example under “Examples,”
following). All arithmetic operations are done using integer arithmetic.
The result of using an
arithmetic expression
for the
variable-value
is to assign the integer result of the operation to the variable.
Examples
In the following example, the SET command creates a variable whose value is a text
string containing a variable. Note that the quotes appearing in the command line will
be part of the COBOL source code that is generated from this macro.
%SET z MOVE “$Server-Class-Name$” TO T9154-SEND-&
%SERVERCLASS
Following are examples of setting variables whose values are arithmetic expressions.
% SET j 17
% SET i j + 1
% SET n ((i * j) + 2) / 3