BookmarkSubscribeRSS Feed
lloraine
Calcite | Level 5
I am trying to create an Excel file using ODS. My file contains 67647 rows. My Excel file is truncated at 65536 rows. Is there anyway to make the overflow go to the next tab in Excel??
3 REPLIES 3
Cynthia_sas
Diamond | Level 26
Hi:
Two easy things to do are
1) use FIRSTOBS= and OBS= to split up the data using TAGSETS.EXCELXP to create the multiple sheets (you could even "macroize" whether the data needed to be split up or not, but the program below shows a simple example, not a macroized one).
OR
2) use BY group processing to break the data into logical groups -- TAGSETS.EXCELXP will put every group into a separate sheet, by default. (of course, this assumes that no single by group is larger than the 65K limit)

cynthia
[pre]
**1) use FIRSTOBS= and OBS=;
ods tagsets.excelxp file='c:\temp\split_file.xls';

proc print data=sashelp.class(firstobs=1 obs=7);
run;

proc print data=sashelp.class(firstobs=8 obs=19);
run;

ods tagsets.excelxp close;



**2) Split into BY groups;
ods tagsets.excelxp file='c:\temp\split_by.xls';

proc print data=sashelp.shoes;
where region in ('Asia', 'Canada', 'Pacific');
by region;
var region subsidiary product sales;
run;

ods tagsets.excelxp close;
[/pre]
lloraine
Calcite | Level 5
If I use the following code to export into ACCESS is there any problem with the number of rows of data?

PROC EXPORT DATA = PS_CLASS_TBL
OUTTABLE = "PS_CLASS_TBL"
DBMS = ACCESS REPLACE;
DATABASE = "C:\CRSE_FACULTY_GRADUATE.MDB";
QUIT;
Cynthia_sas
Diamond | Level 26
Hi:
I don't know the exact answer to that. According to this site:
http://office.microsoft.com/en-us/access/HA100307391033.aspx
the limit for Microsoft Access tables is based on overall file size, not number of rows. (no more than 255 fields in the table with an overall file size of 2 gigabytes, minus the space needed for system objects).

You may want to run a test or double check with Tech Support on this one.

cynthia

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1292 views
  • 0 likes
  • 2 in conversation