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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 7 replies
  • 955 views
  • 1 like
  • 3 in conversation