Previous PageNext Page

Efficiency considerations
If you have mutually exclusive conditions, then you should use cascading IF-THEN/ELSEs.
The way it works:
With the ELSEs, SAS evaluates the IF expressions until it finds one that is true; The first one true is the last expression it evaluates.
Without the ELSEs, SAS evaluates all the IF expressions.

The savings in large data sets is noticeable.
Also, if you put your more common conditions earlier in the IF-THEN/ELSE list the code will run faster.

Previous PageTable Of ContentsNext Page