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 / a.k.naidu

Having clause can be used only with 'group by'. Difference between 'where' and 'having' is that former works on variable level and latter works on observation level. 'having' works like second where condition on "grouped data"

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are several options for creating reports in web report studio? : Sas-bi

733


What is interleaving in SAS?

768


If you were told to create many records from one record, show how you would do this using array and with proc transpose?

1000


What are symget and symput? : sas-macro

843


What is the role of administrative users? : sas-grid-administration

750






What is the basic syntax style in SAS?

713


what other sas products have you used and consider yourself proficient in using? : Sas programming

779


what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake

2006


Are you sensitive to code walk-throughs peer review or QC review?

2719


How can sas program be validated?

660


how will you locate the sas platform applications? : Sas-bi

672


what is business intelligence? : Sas-bi

678


What is the basic structure of a sas program?

690


What is a put statement?

777


What do the mod and int function do? : Sas programming

687