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;

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 16. 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
  • 1 reply
  • 387 views
  • 0 likes
  • 2 in conversation