Very coincidentally, I find there is a where also
statement in SAS.
data test;
set sashelp.class;
where age>13;
where also sex='M';
run;
When I submit this, the log window shows:
NOTE: WHERE clause has been augmented.
NOTE: There were 5 observations read from the data set SASHELP.CLASS.
WHERE (age>13) and (sex='M');
If I directly cat multiple condition by and
and put them in one where
statement:
data test;
set sashelp.class;
where age>13 and sex='M';
run;
The log window shows:
NOTE: There were 5 observations read from the data set SASHELP.CLASS.
WHERE (age>13) and (sex='M');
So here are my questions:
where also
statement and where
statement consisted with multiple conditions?where also
statement can be exactly replaced by where
statement, why SAS designed where also
statement?There is no difference between where also and where statement with multiple conditions.
The benefit of using where also would be the ease of commenting out only one condition? Maybe better readability of the code? It's not the only case in SAS where you can do the exact same thing with different syntax.