%EVAL macro function
From sasCommunity
- This is a work in progress. You can contribute to this article.
The %EVAL macro function evaluates an arithmetic or logical expression using integer arithmetic.
Syntax
- %EVAL( expression )
- expression should be an arithmetic or logical expression that contains integers.
Usage
If a number containing a decimal point is encountered an error may occur because the %EVAL macro function interprets numbers containing decimal points as character strings. To evaluate expressions containing decimals or floating point numbers use the %SYSEVALF macro function.
The %EVAL function has implied usage in the %SCAN macro function, the %SUBSTR macro function, as well as in the iterative %DO macro statement, and in %IF-%THEN/%ELSE processing.