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 is operational data and operational system? : Sas-di

624


How sas treats the dsd delimiters?

709


Explain the use of proc print and proc contents?

548


What is the order of application for output data set options, input data set options and SAS statements?

1073


In SAS explain which statement does not perform automatic conversions in comparisons?

790






Name some categories in sas 9? : sas-grid-administration

549


describe how to adjust the performance of data integrator? : Sas-di

549


Explain proc sort?

655


Mention what is the difference between nodupkey and nodup options?

585


How do you convert basic cube to transaction cube and transaction cube to basic cube?

1761


What is the command used to find missing values?

583


how does sas handle missing values in procs? : Sas programming

627


What is the good sas programming practices for processing large data sets?

621


What will calendar procedure do?

589


what are the categories that sas informats are used to the place the data? : Sas-administrator

606