BookmarkSubscribeRSS Feed
ANON4
Obsidian | Level 7

I am working on a PROC TABULATE report and I nearly have what I need but I am running into the following error when I add too many class levels in the row dimension:

 

ERROR: Limit of 2147483647 potential interactions within a crossing exceeded for the table statement

 

Here is a representation of my table:

 

Capture.PNG

 

Everything works fine when I only have "ID", "YEAR", and "NAME" in the rows but the code fails when I add "ADDRESS".  I understand this is failing because there are too many unique combinations of class levels when I add "ADDRESS".   The table has one row per ID so the YEAR, NAME, ADDRESS, CITY, STATE, and ZIP don't really affect the calculation of Levels A, B, C, D, and E.  Is there a way to show YEAR, NAME, ADDRESS, CITY, STATE, and ZIP on the report without SAS factoring these class levels into the interaction and, hopefully, bypass that error?  If there is no way of adding ADDRESS, CITY, STATE, and ZIP prior to PROC TABULATE processing, is there a way to insert it into the table post-processing by joining, appending, or concatenating tables?

 

Thanks for taking the time to read this post.  I have been searching for a resolution to this for quite some time and I have had no success.

 

PROC TABULATE DATA=WORK.A;
VAR ID_NUM;
CLASS ID / ORDER=UNFORMATTED MISSING;
CLASS YEAR / ORDER=UNFORMATTED MISSING;
CLASS NAME / ORDER=UNFORMATTED MISSING;
CLASS ADDRESS / ORDER=UNFORMATTED MISSING;
CLASS CITY / ORDER=UNFORMATTED MISSING;
CLASS STATE / ORDER=UNFORMATTED MISSING;
CLASS ZIP / ORDER=UNFORMATTED MISSING;
CLASS LEVEL_A / ORDER=UNFORMATTED MISSING;
CLASS LEVEL_B / ORDER=UNFORMATTED MISSING;
CLASS LEVEL_C / ORDER=UNFORMATTED MISSING;
CLASS LEVEL_D / ORDER=UNFORMATTED MISSING;
CLASS LEVEL_E / ORDER=UNFORMATTED MISSING;
TABLE
ID*
YEAR*
NAME*
ADDRESS*
CITY*
STATE*
ZIP,
LEVEL_A*
LEVEL_B*
N
LEVEL_C*
N
LEVEL_D*
LEVEL_E*
N
/ INDENT=0 ;
;
RUN;

1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
Without seeing a sample of your data, it's hard to guess what is going on. However, PROC TABULATE is a summary procedure. That means it is meant to summarize and group data in rows and columns. Typically, you don't have variables like NAME, and ADDRESS in a TABULATE report.

It looks like the only statistic you're asking for is the Count or N statistic, so it is possible you can generate this report with PROC REPORT. However, consider that if you don't have very many duplicate name/address duplicates, then you are likely to get a count of 1 for each crossing cell.

I'd recommend that you create a subset of 50 IDs, which should give you enough rows to test with but not enough to crash TABULATE and make sure that the final structure is what you want. Once you have that final structure, you might want to take a screen shot and post it and your 50 IDs of data here. Then someone might be able to see whether the desired report can be generated by something other than TABULATE.
Cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 819 views
  • 0 likes
  • 2 in conversation