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? 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register 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.

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