Help using Base SAS procedures

How to keep those missing in Proc tabulate?

Reply
Frequent Contributor
Posts: 99

How to keep those missing in Proc tabulate?

Dear all,

When using Proc tabulate,especially 3 dimensions.

the output format can not comply with each other in the first dimension, say "City",because in City 'Houston' for occupation 'Mine' there maybe null and no output, while in City 'Texas' occupation 'Mine' might exist and have count. the output column/row numbers maybe different for city houston and texas.

I want every dimension output with the same output format that is to say to keep all those nill (city houston and texas with the same output column/row numbers), for the purpose for easy copy to excel files.

thanks in advance for your useful reply.

Occasional Contributor
Posts: 14

How to keep those missing in Proc tabulate?

Hi,

Try adding the PRINTMISS option.

Regards,

Henri

Super User
Posts: 5,509

How to keep those missing in Proc tabulate?

bbb_NG,

There are a few options that are related to your question.  Any of these could be added to the PROC TABULATE statement.

MISSING

Normally, PROC TABULATE removes any observations that have a missing value for a CLASS variable.  MISSING requests that they remain in the analysis.

CLASSDATA=

To use this, you have to create a SAS data set holding all the combinations of the CLASS variables that you would like to see in your table (even if no observations actually exist for some of the combinations).  That will get the full set of combinations to appear on the table.  I suspect this is the one that you are looking for, but you will need to create that "shell" SAS data set first.

EXCLUSIVE

In combination with CLASSDATA=, specifies that combinations that appear in the data, but are not in your CLASSDATA= data set, should be removed.

Good luck.

SAS Super FREQ
Posts: 8,866

How to keep those missing in Proc tabulate?

Posted in reply to Astounding

In addition, options PRINTMISS (which has already been discussed) and PRELOADFMT used with PRINTMISS. Take a look at Example 3 in the TABULATE doc for some examples: http://support.sas.com/documentation/cdl/en/proc/63079/HTML/default/viewer.htm#p1f1t9bipbeqy5n1vowhz...

cynthia

Frequent Contributor
Posts: 99

How to keep those missing in Proc tabulate?

Posted in reply to Cynthia_sas

Henri,Astounding,cynthia

Thank you all for your prompt response, please spare me some time to check whether it works.

I'm very appreciated with your help. thanks.

Ask a Question
Discussion stats
  • 4 replies
  • 139 views
  • 0 likes
  • 4 in conversation