proc sort data = sasuser.houses out = houses;
by style;
run;
proc print data = houses;
run;
Click on the Exhibit button to view the report produced.
style bedrooms baths price
CONDO 2 1.5 80050
3 2.5 79350
4 2.5 127150
2 2.0 110700
RANCH 2 1.0 64000
3 3.0 86650
3 1.0 89100
1 1.0 34550
SPLIT 1 1.0 65850
4 3.0 94450
3 1.5 73650
TWOSTORY 4 3.0 107250
2 1.0 55850
2 1.0 69250
4 2.5 102950
Which of the following SAS statement(s) create(s) the report?
A. id style;
B. id style;
var style bedrooms baths price;
C. id style;
by style;
var bedrooms baths price;
D. id style;
by style;
var style bedrooms baths price;
Click Comment link to get answer
answer C
ReplyDeleteCorrect answer is C
ReplyDeleteC
ReplyDeleteHow can it be C. C condition woudl be never true. I think it should be B.
ReplyDeleteproc print data=tempemp split='*';
ReplyDeleteid jobcode;
by jobcode;
var gender salary;
Job Code Gender Annual Salary
FA1 F $23,177.00
F $22,454.00
M $22,268.00
-------- -------------
FA1 $67,899.00
FA2 F $28,888.00
F $27,787.00
M $28,572.00
So the Answer is D
ReplyDeleteI agree with D, but 'style' in var statement should be deleted.
ReplyDeletewhich would be C - style in the var statement is the only difference between C and D.
DeleteCould someone clarify if it's 'C' or 'D' - cannot figure out? Does the 'Style' variable name need to be repeated in the var statement in 'D' or is it sufficient in 'C' to have it in the 'BY' and 'ID'?
ReplyDeleteC and D options are same only diff is that there is style variable in var... But, if the style variable is present in id statement, you don't have to mention it in var statement, else you will get 2 style variable in the output, but since there is just 1 style column present ans is C and not D..
ReplyDeleteif id statement also appear in var statement ,the output contains two columns for that variable....
ReplyDeletefor eg...
proc print data = sales;
id idnum;
var idnum sex jobcode salary;
run;
so the variable idnum appear twice...
ans is c
ANS IS C,,,
ReplyDeletedata dd;
input style $ bedrooms baths price;
datalines;
CONDO 2 1.5 80050
CONDO 3 2.5 79350
CONDO 4 2.5 127150
CONDO 2 2.0 110700
RANCH 2 1.0 64000
RANCH 3 3.0 86650
RANCH 3 1.0 89100
RANCH 1 1.0 34550
SPLIT 1 1.0 65850
SPLIT 4 3.0 94450
SPLIT 3 1.5 73650
TWOSTORY 4 3.0 107250
TWOSTORY 2 1.0 55850
TWOSTORY 2 1.0 69250
TWOSTORY 4 2.5 102950
;
run;
proc print data=dd;
ID STYLE;
BY STYLE;
VAR style bedrooms baths price;
run;
Sakar Sham:
ReplyDeleteAnswer is C.
As someone put his/her logic, if we keep style in var we will have a variable name style, therefore we can not choose D.
Answer is C
ReplyDeletec
ReplyDeletea
ReplyDeleteC
ReplyDeleteHello!! I'am glad to read the whole content of this blog and am very excited.Thank you.
ReplyDeleteตารางคะแนน