SAS Base Programming for SAS 9 — Question 53
The following SAS program is submitted:
proc sort data=SASUSER.PROJECTS out=PSORT;
by Product Code descending Date Cost;
run;
Which of the following is true concerning the submitted program?
Answer options
- A. The descending option applies only to the Date variable.
- B. The descending option applies to the Date and Cost variables.
- C. The descending option applies to the Product and Code variables.
- D. The descending option applies only to the Code variable.
Correct answer: B
Explanation
The descending option in the PROC SORT statement affects all variables listed after it in the BY statement when specified. Therefore, in this case, it applies to both the Date and Cost variables, making option B the correct choice. Options A, C, and D incorrectly limit the application of the descending option to fewer variables.