Multiple choice technology programming languages

When you use an %IF-%THEN statement in your macro program

  1. you must place %DO and %END statements around code that describes the conditional action, if that code contains multiple statements.

  2. the %ELSE statement is optional.

  3. you cannot refer to DATA step variables in the logical expression of the %IF statement.

  4. all of the above.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In SAS macro programming, multiple statements in a conditional block require %DO and %END. The %ELSE clause is optional, and DATA step variables cannot be directly referenced in macro %IF conditions because macros execute before the DATA step compiler runs. Thus, all statements are correct.