SAS Base (21)

Given the SAS data set WORK.PRODUCTS:

ProdId Price ProductType Sales Returns
K12S 95.50 OUTDOOR 15 2
B132S 2.99 CLOTHING 300 10
R18KY2 51.99 EQUIPMENT 25 5
3KL8BY 6.39 OUTDOOR 125 15
DY65DW 5.60 OUTDOOR 45 5
DGTY23 34.55 EQUIPMENT 67 2

The following SAS program is submitted:

data WORK.OUTDOOR WORK.CLOTH WORK.EQUIP;
set WORK.PRODUCTS;
if Sales GT 30;
if ProductType EQ ‘OUTDOOR’ then output WORK.OUTDOOR;
else if ProductType EQ ‘CLOTHING’ then output WORK.CLOTH;
else if ProductType EQ ‘EQUIPMENT’ then output WORK.EQUIP;
run;

How many observations does the WORK.OUTDOOR data set contain?
A. 1
B. 2
C. 3
D. 6

Check Answer
Answer: B

注解:Outdoor data set中的数据需要满足2个条件,Sales大于30以及ProductType为OUTDOOR,只有第四和第五个observation满足条件。

Leave a Reply

Your email address will not be published. Required fields are marked *