BookmarkSubscribeRSS Feed
SRINIVAS_N
Calcite | Level 5

can any one help me 

 

i am little confused difference between 'where and ' & 'also'.

 

 

2 REPLIES 2
SASKiwi
PROC Star

Using WHERE ALSO allows you to apply multiple WHERE statements to a SAS procedure or DATA step simultaneously. The usual behaviour of using multiple WHERE statements is that the last one overwrites any previous ones. WHERE ALSO changes that behaviour to make ALL WHERE statements be used. For example:

 

proc sort data = sashelp.class
               out = class;
  by age;
  where sex = 'F';
  where also age > 14;
* Same result as single statement: where sex = 'F' and age > 14; run;

The effect of the two WHERE statements is to select all females aged over 14.

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

The simplest answer here is that in 16+ of SAS programming I have never seen where also used, nor even come across it until you posted this question.  Logical operators and brackets are the ones used most.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1225 views
  • 0 likes
  • 3 in conversation