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


Please Help Members By Posting Answers For Below Questions

Name some categories in sas 9? : sas-grid-administration

555


Describe the function and untility of the most difficult SAS macro that you have written.

1556


In proc transpose and data step with arrays which one you pick?

2572


I have a dataset concat having a variable a b & c. How to rename a b to e & f?

755


How do you delete duplicate observations in sas?

571






what is broad cast agent? : Sas-bi

593


What are the functions which are used for character handling functions?

612


Differentiate between ceil and floor functions.

656


In SAS explain which statement does not perform automatic conversions in comparisons?

797


what is the difference between calculating the 'mean' using the mean function and proc means? : Sas programming

624


Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?

1908


how the sas basic syntax style described? : Sas-administrator

600


Explain the difference between using drop = data set option in set and data statement?

677


Compare sas with other data analytics tools.

577


What is your favorite all time computer book? Why?

2044