Can we use where and having clauses in a single SAS program.
ex: proc sql;
select a,b,c from test
where state in 'KA'
and having <some condition>.
Is the above program run correctly, if not why ?
Answer Posted / rauthu
Yes, WHERE and HAVING can be used in single program. HAVING must be after GROUP by clause.
Example:
proc sql;
select make, model, avg(msrp) as avgmsrp, msrp
from sashelp.cars
where make ='Honda'
group by model
having avgmsrp < 100000;
quit;
Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
what is SAS OPTIMIZATION?
What is the sas data set? : sas-grid-administration
what is factor analysis? : Sas-administrator
how to do user inputs and command line arguments in sas?
how to change the execute of macro
Explain what is data step?
what is program data vector? : Sas-administrator
What does proc print, and proc contents are used for?
In ARRAY processing, what does the DIM function do?
What do the PUT and INPUT functions do?
what are sas bi dashboard components? : Sas-bi
Describe what are the different levels of administrative users in sas? : sas-grid-administration
How will you use the WHO Drug Dictionary for Reporting Clinical Trials?
What are the different versions of sas that you have used until now? : sas-grid-administration
what are the best practices to process the large data sets in sas programming? : Sas-administrator