Operands in arithmetic or logical expressions are always
text. However, an operand that represents a number can be temporarily
converted to a numeric value when an expression is evaluated. By default,
the macro processor uses integer arithmetic, and only integers and
hexadecimal values that represent integers can be converted to a numeric
value. Operands that contain a period character (for example 1.0)
are not converted. The exception is the %SYSEVALF function. It interprets
a period character in its argument as a decimal point and converts
the operand to a floating-point value on your operating system.
Note: The values of numeric expressions
are restricted to the range of –2**64 to 2**64–1.
Operators in macro expressions are a subset of the
operators in the DATA step (
Macro Language Operators). However, in the macro language,
there is no MAX or MIN operator, and it does not recognize ':', as
does the DATA step. The order in which operations are performed when
an expression is evaluated is the same in the macro language as in
the DATA step. Operations within parentheses are performed first.
Note: Expressions in which comparison
operators surround a macro expression, as in 10<&X<20, might
be the equivalent of a DATA step compound expression (depending on
the expression resolution). To be safe, specify the connecting operator,
as in the expression 10<&X AND &X<20.
Macro Language Operators
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*The symbol to use depends
on your keyboard.
** When you use the
IN operator, both operands must contain a value. If the operand contains
a null value, an error is generated.
|
CAUTION:
Integer
expressions that contain exponential, multiplication, or division
operators and that use or compute values outside the range -9,007,199,254,740,992
to 9,007,199,254,740,992 might get inexact results.