BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
tianerhu
Pyrite | Level 9
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.

1 ACCEPTED SOLUTION

Accepted Solutions
maguiremq
SAS Super FREQ

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.

View solution in original post

5 REPLIES 5
maguiremq
SAS Super FREQ

Hi @tianerhu, what are you thinking so far?

tianerhu
Pyrite | Level 9
i didn't understand what is descending correctly.
and now, I think that I have solved it and just want to make sure.
maguiremq
SAS Super FREQ

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.

tianerhu
Pyrite | Level 9
Thank you for your help.
tianerhu
Pyrite | Level 9
the answer is B .

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 935 views
  • 0 likes
  • 2 in conversation