proc sort data = sydney.demo out = PSORT;
by age descending height weight;
run;
/* which statement is true regarding the submitted program?
A.The descending option applies to the variable height.
B.The variable CODE is sorted by ascending order.
C.The PSORT data set is sorted in the SASUSER library.
D.The descending option applies to the DATE and COST variables.
*/
proc sort data = sydney.demo out = PSORT;
by age descending height weight;
run;
/* which statement is true regarding the submitted program?
A.The descending option applies to the variable height.
B.The variable CODE is sorted by ascending order.
C.The PSORT data set is sorted in the SASUSER library.
D.The descending option applies to the DATE and COST variables.
*/
proc sort data = sydney.demo out = PSORT;
by age descending height weight;
run;
/* which statement is true regarding the submitted program?
A.The descending option applies to the variable height.
B.The variable CODE is sorted by ascending order.
C.The PSORT data set is sorted in the SASUSER library.
D.The descending option applies to the DATE and COST variables.
*/
The following SAS program is submitted:
proc sort data = SASUSER.VISIT out = PSORT;
by code descending date cost;
run;
which statement is true regarding the submitted program?
A. The descending option applies to the variable CODE.
B. The variable CODE is sorted by ascending order.
C. The PSORT data set is stored in the SASUSER library.
D. The descending option applies to the DATE and COST variables.
Thank you for your help.
So, descending in PROC SORT sorts the variable that comes after it and only it. Otherwise, everything else is sorted ascending if it doesn't have descending specified. I think it is B iirc.
Hi @tianerhu, what are you thinking so far?
So, descending in PROC SORT sorts the variable that comes after it and only it. Otherwise, everything else is sorted ascending if it doesn't have descending specified. I think it is B iirc.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.