As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

%EVAL macro function

From sasCommunity
Jump to: navigation, search
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.


%EVAL( expression )
expression should be an arithmetic or logical expression that contains integers.


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.

See also

SAS Support Reference Documentation

SAS Macro Language: Reference: %EVAL Function 9.2, 9.3, 9.4