Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 ?
    

Answers were Sorted based on User's Feedback



Can we use where and having clauses in a single SAS program. ex: proc sql;     select ..

Answer / rauthu

Yes, WHERE and HAVING can be used in single program. HAVING must be after GROUP by clause.
Example:
proc sql;
select make, model, avg(msrp) as avgmsrp, msrp
from sashelp.cars
where make ='Honda'
group by model
having avgmsrp < 100000;
quit;

Is This Answer Correct ?    9 Yes 1 No

Can we use where and having clauses in a single SAS program. ex: proc sql;     select ..

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

Can we use where and having clauses in a single SAS program. ex: proc sql;     select ..

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

Can we use where and having clauses in a single SAS program. ex: proc sql;     select ..

Answer / santhosh

worng

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More SAS Interview Questions

what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming

0 Answers  


What does P-value signify about the statistical data?

0 Answers  


Do you know the features of sas?

0 Answers  


what cause the "error: connect:" and "error in the libname statement" when there weren't any such problems?

0 Answers  


What procedure you used to calculate p-value?

2 Answers   Accenture, Quintiles,


what is the difference between calculating the 'mean' using the mean function and proc means? : Sas programming

0 Answers  


How do you add a number to a macro variable?

2 Answers  


what kind of variables are collected in AE dataset?

3 Answers   Accenture, Quintiles, SAS,


What is the difference between an informat and a format? Name three informats or formats.

13 Answers   Accenture, IBM,


Explain the main difference between the sas procedures and functions? : Sas-administrator

0 Answers  


how to rearrange the data as our wish by using dataset block?

4 Answers   Cognizant,


What are the difference between sas functions and procedures?

0 Answers  


Categories