%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.

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.

See also

SAS Support Reference Documentation

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