DATA Step, Macro, Functions and more

Else-Do vs Else

Reply
Frequent Contributor
Posts: 75

Else-Do vs Else

Hi

 

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

 

Thank you

Super User
Posts: 3,260

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: 7,988

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:

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201951.htm

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