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

Mention what are the data types does SAS contain?

946


what is sas application server, database server, sas olap server and sas metadata server? : Sas-di

801


What is the role of administrative users? : sas-grid-administration

898


what is transformation in sas data integration? : Sas-di

807


What would you change about your job?

2172


explain about data integrator metadata reports? : Sas-di

850


what is slowly changing dimension? : Sas-di

880


what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming

989


Hi Friends, Am Priya,new to your forum. am looking for Interview questions on SAS Platform Administration. I searched everywhere but I couldn't find them,please can anyone help me with complete interview questions normally everyone will face in the interviews on SAS Administration. am really facing problems in the interviews,am not able to answer any of their questions. I would really appreciate all your help if you can email the complete Interview Questions to priyafeb84@gmail.com Kindly awaiting for your reply with eager

1883


Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.

1708


What are the features of SAS?

840


Have you ever used the SAS Debugger?

1504


What is the difference between reading data from an external file and reading data from an existing data set?

950


What is the role of sas grid administrator? : sas-grid-administration

1091


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

824