In the SAS Data step what is the difference between the
subsetting done by Where and subsetting done by If?
Answer Posted / gangadhar
Make sure you apply the following rules when determining
which approach to take when subsetting your data set using
the DATA step. If your subset condition does not meet the
requirements below, then the WHERE and IF statements should
produce identical results. For cases such as this, use the
WHERE statement since it is more efficient. Note that
having both WHERE and IF statements within the same DATA
step has a cumulative effect.
• Can use WHERE statement when only specifying data
set variables
• Use IF statement when specifying automatic
variables or new variables created within DATA step
• Use IF statement when specifying FIRST.BY or LAST.
BY variables
• Use IF statement when specifying data set options
such as OBS = , POINT = or FIRSTOBS =
• In general, use IF statement when merging data sets
to apply subset condition after merging data set
• Use WHERE statement when specifying indexes
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
i want for interview question & answer plz it need immediate send t my mail raviprakashmot@gmal.cm
How to limit decimal places for the variable using proc means?
Do you need to know if there are any missing values?
describe how to adjust the performance of data integrator? : Sas-di
Did you used proc test? when?
How can sas program be validated?
what is study design in while working with SAS? what are screening variables in SAS?
What would you change about your job?
Name any two sas spawners? : sas-grid-administration
Describe 5 ways to do a “table lookup” in SAS?
Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?
what are the best practices to process the large data sets in sas programming? : Sas-administrator
How does the internal authentication work in sas? : sas-grid-administration
What is PDV?
How you can read the variables that you need?