BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
msrenee1984
Obsidian | Level 7

proc tabulate data=R.THEOFFSITEWORK order=data;
class CDPRMASS *THEFACILITY/ASCENDING;
tables THEFACILITY *CDPRMASS/rts=25.row=float;
keylabel n=' ';
run;

 

I need "THEFACILITY" data to output in ascending order ?? its not working...it should be New Hanover then Orange, then Wake?

msrenee1984_0-1638214642570.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
msrenee1984
Obsidian | Level 7

Solved: I removed  "rts=25.row=float", every facility is in alphabetical order now.  Whew!!

thanks 

View solution in original post

5 REPLIES 5
Reeza
Super User
Are you referring to order of the data in the cells? Order controls it by the CLASS variable, not the summarized data, eg. name of the facility in alphabetical ascending/descending.

If you specify order=FREQ then it will sort by frequency which is what I think you want.
msrenee1984
Obsidian | Level 7

Correct, I just want the facility names to be in order not too concerned with the actual data within each cell. My output has about 70 facility names (new hanover, orange, wake, johnson etc.. and the requester said she needs them in order.  So should I put the order statement in place of the ascending command? ?

Reeza
Super User
proc tabulate data=R.THEOFFSITEWORK order=freq;
class CDPRMASS *THEFACILITY;
tables THEFACILITY *CDPRMASS/rts=25.row=float;
keylabel n=' ';
run;

I would try this, but not 100% sure what you want is actually possible.

 

msrenee1984
Obsidian | Level 7

So far no luck but thank you very much for assisting.  I' think you're right maybe its not possible...I figured ascending would do the trick.  I'll have to sort each manually in excel 

msrenee1984
Obsidian | Level 7

Solved: I removed  "rts=25.row=float", every facility is in alphabetical order now.  Whew!!

thanks 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 988 views
  • 2 likes
  • 2 in conversation