Click on the Comments to view the Answers

Wednesday, January 27, 2010


The SAS data set named COMPANY.PRICES is listed below:


prodid price producttype sales returns

K12S 5.10 NETWORK 15 2
B132S 2.34 HARDWARE 300 10
R18KY2 1.29 SOFTWARE 25 5
3KL8BY 6.37 HARDWARE 125 15
DY65DW 5.60 HARDWARE 45 5
DGTY23 4.55 HARDWARE 67 2

The following SAS program is submitted:

libname company 'SAS-data-library';
data hware inter soft;
set company.prices (keep = producttype price);
if price le 5.00;
if producttype = 'HARDWARE' then output HWARE;
else if producttype = 'NETWORK' then output INTER;
else if producttype = 'SOFTWARE' then output SOFT;

How many observations does the HWARE data set contain?
A. 0
B. 2
C. 4
D. 6


SASGuru said...

Answer: B

The if price le 5.00; limits the obs to the below obs out of which HARDWARE has two obs.
B132S 2.34 HARDWARE 300 10
R18KY2 1.29 SOFTWARE 25 5
DGTY23 4.55 HARDWARE 67 2

Rujuta........ said...

B. 2

siva said...

Answer B

smita said...

Answer is 2

Ryan Lo said...

Answer is B.

Filtering by subsetting IF statement (if price le 5.00;)

Resulting only 3 obs (as following) to compare whether PRODUCTTYPE equal to 'HARDWARE' or not.

B132S 2.34 HARDWARE 300 10
R18KY2 1.29 SOFTWARE 25 5
DGTY23 4.55 HARDWARE 67 2

Gaurav Verma said...


nedved said...


SAS Cert said...

Have any of you passed the Advanced SAS Certification by chance? I just started studying for the exam and was wondering if you all had any tips that helped you pass.

Some of my specific questions are at my blog below:

Thanks in advance!

ganesh said...


gaurav said...


Harsh Mohan said...

For latest and updated SAS certification dumps in PDF format contact us at
Refer our blog for more details

Post a Comment

Technology Top Blogs On our way to 1,000,000 rss feeds - Blog Directory - blogarama - the blog directory Blog Directory

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.

Other brand and product names are trademarks of their respective companies.

This blog is not responsible for any kind of copyright violation. This blog just collects the links hosted or posted by other servers/people/search engines.The creator of this page or the ISP(s) hosting any content on this site take no responsibility for the way you use the information provided on this site.If anybody has any copyright claim on it and doesn’t wish the information provided to be shown on our site, please do respond to this email. We shall remove them off immediately. Any inconvenience is regretted. Please do mention your exact grievance/problems with respect to certain third party links. We assure you that appropriate action will be taken off. Thank you