DATA Step, Macro, Functions and more

proc tabulate too many dimensions

Reply
Contributor
Posts: 42

proc tabulate too many dimensions

Hi,

 

How do I create a proc tabulate with 23 columns (each column is a different variable)? I get an error saying their are too many dimensions when using a small sample below.

 

proc tabulate data=test.testing;
class pdte;
var F1 F1V F2 F2V;
table (pdte="2") *
(F1="1") ,
(F1V="2") ,
(F2="3") ,
(F2V="4");
run;

 

 

Super User
Posts: 6,933

Re: proc tabulate too many dimensions

Posted in reply to Brandon16

I'm not sure I can take you through all the steps you need to get a working program.  But I can at least answer this question and leave the subsequent questions to you.

 

PROC TABULATE allows just three dimensions.  You can define the pages, the rows, and the columns.  Within a TABLE statement, the comma is a key symbol that separates one dimension from the next.  So you can use at most two commas in a single TABLE statement.

 

To make PDTE the rows, and add a separate column for each of your variables, the TABLE statement would look more like this:

 

table pdte="2",

   F1="1"  F1V="2"  F2="3"  F2V="4";

 

The spacing and indentation are arbitrary ... whatever is easily readable is OK.

Contributor
Posts: 42

Re: proc tabulate too many dimensions

Posted in reply to Astounding

That makes sense, thank you. I need to get the data currently in a dataset into a format where I can automate it into excel. Without using a Tabulate, im not sure how else I would go about doing it, any ideas at all please?

 

Super User
Posts: 6,933

Re: proc tabulate too many dimensions

Posted in reply to Brandon16

I'm not an Excel user, so can't be that much help.  But I would guess the easiest thing to port over to Excel would be a SAS data set.  Why try to port over a report (which can take on many different forms), when you can port a data set?

Ask a Question
Discussion stats
  • 3 replies
  • 103 views
  • 0 likes
  • 2 in conversation