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

Is there an option that you can write in proc freq where we can only view  the table only with values and not 0's

 DRESS 1DRESS 2DRESS 3DRESS 4DRESS 5DRESS 6DRESS 7
BLUE000003410
YELLOW0006000
PINK00000180
RED0000000
GREEN0500042779
PURPLE000120363
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

One way is to use a different procedure. You did not show any actual Proc Freq code to give variables or options but a basic cross table can be done such as

 

proc tabulate data=sashelp.class;
  class sex age;
  table sex, age *n=''
       /misstext=' ';
run;

The n=' ' just suppresses a default column heading of N for the count.

The table option of misstext=' ' says to display a blank for missing values. The 0 in proc freq comes from a missing combination.

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

Does this mean that dress 1, 3 and 5 should be omitted?

Gladis6680
Obsidian | Level 7

What I would like is below, but I don't think its as easy as I thought.

 

 DRESS 6DRESS 7 
BLUE3410 
    
 DRESS 4  
YELLOW6  
    
 DRESS 6  
PINK18  
    
 DRESS 2DRESS 6DRESS 7
GREEN542779
    
 DRESS 4DRESS 6DRESS 7
PURPLE12363
ballardw
Super User

One way is to use a different procedure. You did not show any actual Proc Freq code to give variables or options but a basic cross table can be done such as

 

proc tabulate data=sashelp.class;
  class sex age;
  table sex, age *n=''
       /misstext=' ';
run;

The n=' ' just suppresses a default column heading of N for the count.

The table option of misstext=' ' says to display a blank for missing values. The 0 in proc freq comes from a missing combination.

Gladis6680
Obsidian | Level 7

thank you, but I think I my have not explained my problem well enough 

I just added a proc freq, table /list

that gave me a concise table that looks like this, without the 0's

Foodbuy_SubCategoryManufacturerFrequencyCumulative
Frequency
Beef BoxedMaple Leaf22
Beef Boxed CookedHospital Food Services (HFS)24
Beef BrisketErie Meat Products37
Beef BrisketLesters Foods212219

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 4 replies
  • 2956 views
  • 0 likes
  • 3 in conversation