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

I'm trying to use PROC TABULATE to calculate counts and amounts for a set of months for a set of data.  Some commands may not appear in all months.  The problem is that SAS EG 5.1 by default does not print out headers for missing data and I need all the Commands printed out that occurred in that year, regardless of whether they occurred in that month.   I tried to use the PRINTMISS command after the TABLE statement, to no avail.


PROC TABULATE

   DATA = BENDATA;

       VAR AMOUNT;

   CLASS MONTH / ORDER= UNFORMATTED MISSING;

   CLASS COMMAND / ORDER = UNFORMATTED MISSING;

     TABLE MONTH * COMMAND,

                  AMOUNT * N PRINTMISS ;

;

RUN;

QUIT;

I get an error that says:  "That type of name (PRINTMISS) is unknown."

What is the workaround for this in SAS EG 5.1?

Thanks,
Ben

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The PRINTMISS error is occurring because you are missing a / to indicate non- page/row/column options.

One way IF you know there is a limited and not constantly changing list of commands is to create a custom format that is not very exciting:

proc format;

     value $command   /* assuming it is character*/

"Command1" = "Command1"

"Command2" = "Command2"

<continue>

;

run;

Then in proc tabulate add PRELOADFMT to the options for the command variable and

format command $command. ; to use the Command format.

View solution in original post

7 REPLIES 7
Steelers_In_DC
Barite | Level 11

I would add a dummy id before this step, populate 'A' or 1 for each variable.  Then after this step you can run another step that deletes your dummy id.:

Benbo123321
Calcite | Level 5

how would i go about doing that?  The code above is system generated using the UI.

Steelers_In_DC
Barite | Level 11

how many columns does BENDATA have?  If you provide a list of the columns and if they are character or numeric I'll show you the code.

Benbo123321
Calcite | Level 5

It has 3: Month, Command, and Amount. The first two are character, the last, numeric (?).  It is the summary count.

Ben

Benbo123321
Calcite | Level 5

To be clear; BENDATA has many columns.  The only ones I care about are the two above and the summary count on the AMOUNT variable.

ballardw
Super User

The PRINTMISS error is occurring because you are missing a / to indicate non- page/row/column options.

One way IF you know there is a limited and not constantly changing list of commands is to create a custom format that is not very exciting:

proc format;

     value $command   /* assuming it is character*/

"Command1" = "Command1"

"Command2" = "Command2"

<continue>

;

run;

Then in proc tabulate add PRELOADFMT to the options for the command variable and

format command $command. ; to use the Command format.

Benbo123321
Calcite | Level 5

thank you so much.  you solved my problem. 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1448 views
  • 1 like
  • 3 in conversation