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

issue: i'm trying to use PROC FORMAT to control the order of the TABULATE output.

output I have: 

2 - Approaches 1 - Does Not
Meet
4 - Exceeds 3 - Meets

 

what I want:

1 - Does Not
Meet
2 - Approaches   3 - Meets 4 - Exceeds

 

my code:

 

proc format;
value $scr_lev
'Does Not Meet' = '1 - Does Not Meet'
'Approaches'= '2 - Approaches'
'Meets' = '3 - Meets'
'Exceeds' = '4 - Exceeds';
run;

proc tabulate data=math3;
class grade schlevel;
class performance_level;
tables grade all='TOTAL', 
performance_level*(pctn<performance_level>='PCT'*f=6.1) 
all='TOTAL'*(n*f=6.0)/rts=25 misstext='0' printmiss;
format performance_level $scr_lev. ;
run;

sample data:

 

grade  schlevel      performance_level 

3           ELEM        Does Not Meet

4           ELEM         Meets

5            ELEM         Approaches

6           MIDD          Exceeds

7            MIDD          Meets

8            MIDD          Does Not Meet

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Try

 

class performance_level / order=formatted;

View solution in original post

1 REPLY 1
ballardw
Super User

Try

 

class performance_level / order=formatted;

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1345 views
  • 0 likes
  • 2 in conversation