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

how can you create zero observation dataset? : Sas programming

644


If you could design your ideal job, what would it look like?

2378


I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). Please help.

1700


Hello Friends, am new to this forum and am not good at sas progarmming. please can any one of you send me couple of sample large sample SAS Jobs which can you use 200 MB of data and other sas job upto 25GB of data. am doing a performance testing on our legacy systems and new upgraded system. I would really appreciate if you can do me this favor Thank you Priya

1358


What are the different types of sas functions?

612






Mention few capabilities of sas framework.

696


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

806


what do you mean by data staging area? : Sas-di

607


What are the different servers in sas? : sas-grid-administration

605


Tell e how how dealt with..

1759


how to do user inputs and command line arguments in sas?

2432


explain about various caches available in data integrator? : Sas-di

584


what is intially documentation in sas?

4335


What do you know about sas data set?

599


Mention what is SAS data set?

679