DATA Step, Macro, Functions and more

Else-Do vs Else

Frequent Contributor
Posts: 76

Else-Do vs Else



Using SAS 7.1, what is the difference between "Else" and "Else Do"


Thank you

Super User
Posts: 3,911

Re: Else-Do vs Else

You use ELSE for a single statement, ELSE DO with an END statement for multiple statements.



Super User
Super User
Posts: 9,599

Re: Else-Do vs Else

It is called a block.  If you have one statement after the conditonal you just put the one statement.  If you have multiple statements then they become a block, defined by do end.  See the documentation:

Ask a Question
Discussion stats
  • 2 replies
  • 1 like
  • 3 in conversation