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

How do you add a number to a macro variable? : sas-macro

760


hi here is a problem can anybody solve this? i want to report the data through third party file. by using data _null_ or proc report or macro automation process. but i want to insert the 'titles and footnotes' in between the data and also starting of 2nd and ending of 2nd and starting of 3rd and ending of the 3rd page. tell me how and write the code?

1898


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

814


what is the limit of the number of the rows and columns available in the worksheet? : Sas-bi

864


what is PhaseIII, ODS, TLG, Macro and Proc in SAS

4161


how many types of prompts are there? : Sas-bi

769


Name validation tools used in SAS

919


how are numeric and character missing values represented internally? : Sas programming

885


How sas treats the dsd delimiters?

967


explain what is factor analysis? : Sas-administrator

859


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

846


explain the difference between proc means and proc summary?

891


explain the key concept of sas? : Sas-administrator

765


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

876


how do you test for missing values? : Sas programming

801