ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 29

The following SAS program is submitted:
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

18 comments:

  1. Anonymous8:41 AM

    Correct answer is C

    ReplyDelete
  2. Anonymous12:16 PM

    How can it be C. C condition woudl be never true. I think it should be B.

    ReplyDelete
  3. Anonymous11:28 AM

    proc print data=tempemp split='*';
    id 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

    ReplyDelete
  4. Anonymous11:30 AM

    So the Answer is D

    ReplyDelete
  5. Anonymous11:48 PM

    I agree with D, but 'style' in var statement should be deleted.

    ReplyDelete
    Replies
    1. Anonymous1:27 PM

      which would be C - style in the var statement is the only difference between C and D.

      Delete
  6. Anonymous4:25 PM

    Could 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'?

    ReplyDelete
  7. Anonymous8:59 PM

    C 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..

    ReplyDelete
  8. Anonymous5:40 AM

    if id statement also appear in var statement ,the output contains two columns for that variable....
    for eg...
    proc print data = sales;
    id idnum;
    var idnum sex jobcode salary;
    run;

    so the variable idnum appear twice...



    ans is c

    ReplyDelete
  9. ANS IS C,,,
    data 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;

    ReplyDelete
  10. Anonymous2:12 PM

    Sakar Sham:

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

    ReplyDelete
  11. Anonymous8:12 AM

    Answer is C

    ReplyDelete
  12. Hello!! I'am glad to read the whole content of this blog and am very excited.Thank you.
    ตารางคะแนน

    ReplyDelete