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 do the put and input function do?
Explain the difference between using drop = data set option in set and data statement?
Difference between informat and format?
WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?
What are SAS/ACCESS and SAS/CONNECT?
For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration
what are several options for creating reports in web report studio? : Sas-bi
what is information maps?
How do you define proc in sas? : sas-grid-administration
what is transformation in sas data integration? : Sas-di
What are the prime responsibilities of data integration administrator? : Sas-di
Explain the use of proc print and proc contents?
Explain substr function?
Describe the ways in which you can create macro variables?
what is hierarchy flattening? : Sas-di