Help using Base SAS procedures

PROC TABULATE ORDER=FREQ only for rows

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 90
Accepted Solution

PROC TABULATE ORDER=FREQ only for rows

proc tabulate data=CA_NON_REFER  ORDER=FREQ;

class application_month CHECKLIST_FAIL;

table CHECKLIST_FAIL * (N COLPCTN) , application_month  ;

run;

Hi,

This is a cross tabulation simplified version of my code; of the number of application coming in each month, what is the top checklists that fail.

Application Month on the Y-axis, Checklist on the X-axis.

I use ORDER=FREQ to sort by frequency, and it is working on the y-axis checklists. But I don't want the x-axis application month to be sorted by frequency.

Besides workarounds, is there a build-in function in proc-tabulate for sorting frequency only for rows?


proctabulate_orderfreq.png

Accepted Solutions
Solution
‎08-04-2011 07:46 AM
Respected Advisor
Posts: 3,777

PROC TABULATE ORDER=FREQ only for rows

Remove the ORDER= option from the PROC statement and move it to the CLASS statement to which it applies.

proc tabulate data=sashelp.class;

   class sex;

   class age / order=freq;

   tables age,sex;

   run;

View solution in original post


All Replies
Super User
Posts: 9,682

PROC TABULATE ORDER=FREQ only for rows

Could you make a format then using this format to customize the order.

class ../preloadfmt order=formate/data?

Ksharp

Solution
‎08-04-2011 07:46 AM
Respected Advisor
Posts: 3,777

PROC TABULATE ORDER=FREQ only for rows

Remove the ORDER= option from the PROC statement and move it to the CLASS statement to which it applies.

proc tabulate data=sashelp.class;

   class sex;

   class age / order=freq;

   tables age,sex;

   run;

Frequent Contributor
Posts: 90

PROC TABULATE ORDER=FREQ only for rows

Thank you both for helping.

proc tabulate data=CA_NON_REFER ;
class application_month;

class CHECKLIST_FAIL /ORDER=FREQ;
table CHECKLIST_FAIL * (N COLPCTN) , application_month  ;
run;

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 2181 views
  • 0 likes
  • 3 in conversation