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

Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.