Exam A00-211 All QuestionsBrowse all questions from this exam
Question 28

Given the SAS data set WORK.TEMPS:

The following program is submitted:

Which output is correct?

    Correct Answer: A

    The program sorts the data set WORK.TEMPS first by descending Month and then by descending Day. Since Month is a character variable, sorting in descending order will arrange the months alphabetically in reverse order (July, June, May). Within each month, the days will be sorted in descending order. Therefore, the correct output will list the observations with months starting from July, then June, and finally May, with days sorted in descending order within each month. This matches Option A.

Discussion
mhminkovOption: C

given answer C is correct, .. sort is descending on a character variable, so it goes backwards in the alphabet from May to JUNe to JULy and ascending on day (so not D). data temps; infile datalines; input day month $ temp; datalines; 1 May 75 15 May 70 15 June 80 3 June 76 2 July 85 14 July 89 ; proc sort data=work.temps; by descending month day; run; proc print data=work.temps; run;

KleinstoneOption: A

month is a string variable, so july < june <may. the answer is A.