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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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