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 the basic syntax style in SAS?

820


Explain the purpose of retain statement.

779


Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.

1657


For clinical entire study how many tables will create approx?

1701


how can you import .csv file in to sas? : Sas programming

818






what does the run statement do? : Sas programming

755


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

1974


Name and describe few sas character functions that are used for data cleaning in brief.

857


What are all the problems you faced while validating tables and reports?

3204


What are types of transport files?

7322


Given an unsorted data set, how to read the last observation to a new data set?

1068


how to generate the test data in sas without input data? : Sas-administrator

786


name several ways to achieve efficiency in your program? : Sas programming

751


What is the difference between input and infile statement?

857


Which function is used to count the number of intervals between two sas dates?

812