09-26-2015 08:16 PM
Is there any processing difference between where statement or where = data set option?
set temp1(where = (state = 'NJ');
where state = 'NJ';
which is better in terms of performance? I know we will get same result but is there any performace improvement if use as datas set option compare to sas statement.
09-26-2015 08:51 PM
There is no difference in speed, and no difference in how the processing takes place.
Differences are in the flexibility when using more than one incoming SAS data set. Examples:
merge a b;
Now the WHERE statement applies to both incoming data sets, so GENDER must appear in both. Compare that with:
merge a (where=(gender='M')) b (where=(age > 21));
By using WHERE as a data set option, separate conditions can be applied to each incoming DATA set. A stand-alone WHERE statement would not be possible to accomplish the same task.