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
How many ways to overcome a missing values???
What are symget and symput? : sas-macro
What is the good sas programming practices for processing large data sets?
How would you define the end of a macro?
how does sas handle missing values in formats? : Sas programming
How long can a macro variable be? A token? : sas-macro
What is a macro routine?
Enlist the functions performed by sas.
How you are maintaining sas programmes in your company...any specific version control software you are using? If so, tell me the name?
If you could design your ideal job, what would it look like?
What is the difference between using drop = data set option in data statement and set statement?
What is a put statement?
Describe crosslist option in tables statement?
name some data transformation used in sas di? : Sas-di
For clinical entire study how many tables will create approx?