BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Is this possible? I am running a tabulate that then creates a table using ods. In the tabulate (and therefore the output table) I want to see all possible combinations of variables, even if the total is zero. So I want to ensure that all possible row and column headings are in the tabulate, even if they contain no data and where the data does not exist I want the table to contain a zero not a period.

Is this easy? I've been trying to use printmiss and preloadfmt but I don't know the syntax and can't seem to find any non-confusing online resource.

This is an example of my tabulate so far:

proc tabulate data=dataset;
class char1 char2;
var values;
table char1, char2*values / printmiss;
ods output table=fred;
run;

Where do I put the preloadfmt or am I chasing a red herring up the wrong tree again?
2 REPLIES 2
Bill
Quartz | Level 8
add misstext='0' to the options section of the tabulate statement, i.e. with the printmiss option.
Cynthia_sas
SAS Super FREQ
Hi:
PRINTMISS goes on the TABLE statement, after a slash and PRELOADFMT goes on the CLASS statement for the CLASS variable whose format should be loaded. And then, of course, you need to make sure the format is assigned by having a FORMAT statement in the program (or by making surethe format is permanently assigned). This Tech Support note has some nice sample code:
http://support.sas.com/kb/25/101.html

cynthia

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