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 the function of catx syntax? : Sas-administrator
how can you put a "trace" in your program? : Sas programming
if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation
what is slowly changing dimension? : Sas-di
Describe the ways in which you can create a macro variable?
How would you identify a macro variable? : sas-macro
Describe a time when you were really stuck on a problem and how you solved it?
List down the reasons for choosing sas over other data analytics tools.
describe the interaction table in sas di? : Sas-di
Explain data step in SAS
Mention what is the difference between nodupkey and nodup options?
Describe the function and untility of the most difficult SAS macro that you have written.
What is your favorite all time computer book? Why?
what is snowflake schema? : Sas-di
What do the PUT and INPUT functions do?