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
Give e an example of..
What are the different versions of sas that you have used until now? : sas-grid-administration
explain the key concept of sas? : Sas-administrator
How to specify variables to be processed by the freq procedure?
What do you code to create a macro? : sas-macro
How do you test for missing values?
How to sort in descending order?
What are the special input delimiters used in SAS?
how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming
How to test the debugging in sas?
What is the difference between match merge and one to one merge?
what do the pad and dim functions do? : Sas programming
what are some differences between proc summary and proc means? : Sas programming
how will you locate the sas platform applications? : Sas-bi
what is change analysis in sas di ? : Sas-di