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-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!

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.

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