BookmarkSubscribeRSS Feed
bbb_NG
Fluorite | Level 6

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.

4 REPLIES 4
HenriTheuwissen
Calcite | Level 5

Hi,

Try adding the PRINTMISS option.

Regards,

Henri

Astounding
PROC Star

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.

Cynthia_sas
SAS Super FREQ

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

bbb_NG
Fluorite | Level 6

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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