Conditional Processing

The %IF-%THEN Statement and %ELSE Statement

A Brief Overview

You can perform conditional execution at the macro level with %IF-%THEN and %ELSE statements.
Although they look similar, the %IF-%THEN/%ELSE statement and the IF-THEN/ELSE statement belong to two different languages. Most of the same rules that apply to the DATA step IF-THEN/ELSE statement also apply to the %IF-%THEN/%ELSE statement. However, there are several important differences between the macro %IF-%THEN statement and the DATA step IF-THEN statement.
%IF-%THEN Rules
IF-THEN Rules
Can be used both inside or outside a macro program.
Is used only in a DATA step program.
Executes during macro execution.
Executes during DATA step execution. ...

Get SAS Certified Professional Prep Guide 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.