O'Reilly logo

SAS Certification Prep Guide, 4th Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Arithmetic and Logical Expressions

The %EVAL Function

The %EVAL function evaluates integer arithmetic or logical expressions. Logical expressions and arithmetic expressions are sequences of operators and operands forming sets of instructions that are evaluated to produce a result.
  • An arithmetic expression contains an arithmetic operator.
  • A logical expression contains a logical operator.
General form, %EVAL function:
%EVAL(arithmetic or logical expression)
The %EVAL function
  • translates integer strings and hexadecimal strings to integers
  • translates tokens representing arithmetic, comparison, and logical operators to macro-level operators
  • performs arithmetic and logical operations.
For arithmetic ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required