View Single Post
Old 11-29-2011, 02:21 PM
Gareth Keenan's Avatar
Gareth Keenan Gareth Keenan is offline
Join Date: Feb 2006
Location: Garden State
Studying for #9
Favorite beer: butter
Posts: 1,308
Default if vs else if vs else

Is there a logic for when to use if vs else if vs else ?

I'm creating a new variable in a data step based on another variable I all ready have. I feel like you should end with else, which is like saying, "if none of the above criteria matched, just do whatever the else tells you to do."

I also imagine, you have to begin with an if, otherwise beginning with an else if doesn't make logical sense. It probably doesn't make syntax sense, but if I understood this situation, I would not be posting here for help.

when after your first "if" do you use "if" or "if else" or "else"


Gareth Keenan
Reply With Quote
Page generated in 0.08746 seconds with 9 queries