ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 71

The SAS data set WORK.AWARDS is listed below:
fname points
Amy 2
Amy 1
Gerard 3
Wang 3
Wang 1
Wang 2
The following SAS program is submitted:
proc sort data = work.awards;
by descending fname points;
run;
Which one of the following represents how the observations are sorted?
A. Wang 3
Gerard 3
Wang 2
Amy 2
Wang 1
Amy 1
B. Wang 3
Wang 2
Wang 1
Gerard 3
Amy 2
Amy 1
C. Wang 3
Wang 1
Wang 2
Gerard 3
Amy 2
Amy 1
D. Wang 1
Wang 2
Wang 3
Gerard 3
Amy 1
Amy 2
Click Comment link to get answer

22 comments:

  1. Replies
    1. Anonymous7:11 PM

      Fek You Usha

      Delete
    2. Yeah, for giving out the wrong answer. Fuck you, Usha

      Delete
  2. Anonymous4:51 PM

    ITS D
    data awards;
    input Name $ Points;
    cards;
    Amy 2
    Amy 1
    Gerard 3
    Wang 3
    Wang 1
    Wang 2
    ;
    proc sort data=awards;
    by decending Name Points;
    Run;

    Proc print data=awards;
    Run;

    /*****RESULTS
    The SAS System 16:39 Sunday, November 19, 2000 1

    Name Points

    Wang 1
    Wang 2
    Wang 3 Gerard 3
    Amy 1
    Amy 2

    ReplyDelete
  3. it displays descending order for the first variable so ans is d

    ReplyDelete
  4. Anonymous3:34 PM

    sorry its not B ,its D.

    ReplyDelete
  5. Anonymous6:06 PM

    data awards;
    input Name $ Points;
    cards;
    Amy 2
    Amy 1
    Gerard 3
    Wang 3
    Wang 1
    Wang 2
    ;
    proc sort data=awards;
    by decending Name decending Points;
    Run;

    Proc print data=awards;
    Run;

    OUTPUT:

    Obs Name Points

    1 Wang 3
    2 Wang 2
    3 Wang 1
    4 Gerard 3
    5 Amy 2
    6 Amy 1

    ReplyDelete
  6. Anonymous2:09 PM

    Reason: Name is sorted in Desceding order and it can by any Wang but points is by default sorted in ascendign order therefore
    name: points
    wang 1
    wang 2
    wang 3 and so on.

    ReplyDelete
  7. Anonymous2:23 AM

    Reason is SAS only applies the descending order to the immediate variable next to it, the descending term wont affect the second variable points...

    ReplyDelete
    Replies
    1. Excellent, this clarified my confusion. Thanks.

      Delete
  8. Meenal3:37 PM

    The answer is D. fname is descending & points in ascending order.

    ReplyDelete
  9. Thank you all for the comments

    ReplyDelete
  10. Anonymous10:59 PM

    why not C

    ReplyDelete