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 auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro
What is the SAS data set?
what are _numeric_ and _character_ and what do they do? : Sas programming
How long can a macro variable be? A token? : sas-macro
what is the basic structure sas administrator? : Sas-administrator
How can I remove header from output data set?
Mention what is SAS data set?
What is the good sas programming practices for processing large data sets?
What do the SAS log messages "numeric values have been converted to character" mean?
explain the main difference between the nodup and nodupkey options? : Sas-administrator
What are the different operating system platforms in which we can use sas? : sas-grid-administration
what is data integration? : Sas-di
How would you include common or reuse to be processed along with your statements?
How are numeric and character missing values represented internally?
what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming