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

Here is the sample data and proc tabulate process, the results show as follows table A1. I need all those formats in proc format to be shown in final table as table A2. Is anyone know how to do it? I need some help. Thanks a lot.

 

data race;
input race ;
cards;
1
1
1
2
2
2
3
3
3
4
4
4
run;

proc format;
value race 0 = '00 race0'
1 = '01 race1'
2 = '02 race2'
3 = '03 race3'
4 = '04 race4'
5 = '05 race5';
run;

 

proc tabulate data=race order=formatted;
class race;
format race race.;
table race,n;
run;

 

table A1

raceN
01 race13
02 race23
03 race33
04 race43

 

table A2

raceN
00 race00
01 race13
02 race23
03 race33
04 race43
05 race50
1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Use options missing = 0, and the preloadfmt and printmiss options:

options missing = 0;

proc tabulate data=race order=formatted;
class race / preloadfmt;
format race race.;
table race,n / printmiss;
run;

View solution in original post

5 REPLIES 5
Kurt_Bremser
Super User

Use options missing = 0, and the preloadfmt and printmiss options:

options missing = 0;

proc tabulate data=race order=formatted;
class race / preloadfmt;
format race race.;
table race,n / printmiss;
run;
EC189QRW
Obsidian | Level 7

Thank you so much!!! LOL

EC189QRW
Obsidian | Level 7

Thanks Kurt, I just read Maxim 1- 48 three times. It helps a lot. I think i really need pay much more attention on the documentations. Here is another question, If you find a problem how do you locate the keywords in documents? Ctrl+F? 

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
  • 5 replies
  • 2392 views
  • 3 likes
  • 2 in conversation