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
Mention what are the data types does SAS contain?
what is sas application server, database server, sas olap server and sas metadata server? : Sas-di
What is the role of administrative users? : sas-grid-administration
what is transformation in sas data integration? : Sas-di
What would you change about your job?
explain about data integrator metadata reports? : Sas-di
what is slowly changing dimension? : Sas-di
what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming
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
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.
What are the features of SAS?
Have you ever used the SAS Debugger?
What is the difference between reading data from an external file and reading data from an existing data set?
What is the role of sas grid administrator? : sas-grid-administration
I have a dataset concat having variable a b & c. How to rename a b to e & f?