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 will you use the WHO Drug Dictionary for Reporting Clinical Trials?

2076


Differentiate input and infile.

797


What is the command used to find missing values?

774


what do the sas log messages "numeric values have been converted to character" mean? What are the implications? : Sas programming

878


What are the functions used for character handling?

853






what is sas database server? : Sas-di

793


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

1045


How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?

833


Can you execute a macro within a macro? Describe. : sas-macro

843


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

1278


What are the functions which are used for character handling functions?

803


what are informats in sas? : Sas-administrator

758


explain the function of substr in sas? : Sas-administrator

746


What does the trace option do?

847


Which date function advances a date, time or datetime value by a given interval?

853