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 / rajasekaran

having statement should mentioned after group by statement only

proc sql;
select a,b,c from test
where state in 'KA'
group by xyz
and having <some condition>.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

2719


Mention sas system options to debug sas macros.

758


how would you determine the number of missing or nonmissing values in computations? : Sas programming

775


What do you know about sas data set?

687


What are the difference between sas functions and procedures?

731






what is slowly changing dimension? : Sas-di

733


What is a method to debug and test your SAS program?

832


how does sas handle missing values in assignment statements? : Sas programming

662


What commands are used in the case of including or excluding any specific variables in the data set?

709


what is operational data and operational system? : Sas-di

735


Explain data step in SAS

723


What is the purpose of _character_ and _numeric_?

701


what are all the reports you generated in your recent project?

1794


How can I remove header from output data set?

2202


explain about data integrator metadata reports? : Sas-di

658