BookmarkSubscribeRSS Feed
Brandon16
Obsidian | Level 7

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;

 

 

3 REPLIES 3
Astounding
PROC Star

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.

Brandon16
Obsidian | Level 7

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?

 

Astounding
PROC Star

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?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1865 views
  • 0 likes
  • 2 in conversation