Friday, October 20, 2006

Where or If?

When is it most efficient to use a WHERE statement vs. a subsetting IF statement? The answer is (of course) it depends.

When subsetting from a large dataset, WHERE processing is usually more efficient because WHERE statements are evaluated before an observation is read into the program data vector. Subsetting IF statements test the condition after an observation is read into the program data vector.

However, you cannot use WHERE processing on anything other than a variable value that already exists.

Subsetting IF statements must be used in expressions that use:
• Values from raw data
• Values calculated or assigned during the course of the data step
• Automatic variables created in a data step (ex: first.variable , last.variable, _N_)

WHERE expression examples:
proc print data=work.enrollment;
where district='227913';
run;
proc print data=work.enrollment (where=(birthdate = '01SEP2000'D));
run;

proc sql;
select district, sum(students) as Students
from work.enrollment
where district='227901';
quit;

9 Comments:

At 3:30 AM, Blogger karthika revathi said...


Really very nice blog information for this one and more technical skills are improve,i like that kind of post.

CCNA Training in Chennai

 
At 6:10 AM, Blogger Priscilla said...

Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care.As always, we appreciate your confidence and trust in us..SAP Training in chennai

 
At 5:29 AM, Blogger Priscilla said...


Thanks a lot for all your valuable article! We are really happy about the your thoughts... SAP Training in chennai

 
At 7:13 AM, Blogger Nainika Joseph said...

Really very nice blog information for this one and more technical skills are improve,i like that kind of post.


SAP training in Chennai

 
At 4:57 AM, Anonymous Maani kamili said...

Really, these quotes are the holistic approach towards mindfulness. In fact, all of your posts are. Proudly saying I’m getting fruitfulness out of it what you write and share. Thank you so much to both of you.

Digital marketing company in Chennai

 
At 5:49 AM, Blogger Aasha said...

Really nice information you had posted. Its very informative and definitely it will be useful for many people

Digital Marketing For Small Business in Chennai

 
At 12:48 AM, Blogger Shalini said...

Superb i really enjoyed very much with this article here. Really its a amazing article i had
ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and
please keep update like this excellent article.thank you for sharing such a great blog with
us. expecting for your updation.
seo company in chennai

 
At 8:57 PM, Blogger Jeffy said...

Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting. So know it's helpful..
SEO Company in Chennai
Digital Marketing Company in Chennai

 
At 3:55 AM, Blogger Alwin Co Daan said...

I have read your blog its very attractive and impressive. I like it your blog.

Digital Marketing Company in Chennai Digital Marketing Agency

 

Post a Comment

<< Home