BookmarkSubscribeRSS Feed
Linda_V
Obsidian | Level 7

I'm trying to export more than 256 columns as an excel file or a .csv file.  Can this be done with SAS 9.2 ??

6 REPLIES 6
Haikuo
Onyx | Level 15

Hi,

It has nothing to do with SAS. 256 is the limit of Excel before 2007 version.  Before 2007, the column limit is 256, and the row limit is 16k; while after 2007, the column limit is 64k and the row limit is 1M.

Regards,

Haikuo

Linda_V
Obsidian | Level 7

Thanks..   I have Excel 2010.   Do I need to load any special Excel Add-ins?

PGStats
Opal | Level 21

The problem is not with Excel, it is with the library used to access it (JET or ACE). For a somewhat clunky workaround, look at the split255 macro described here :

http://support.sas.com/kb/36/904.html

PG

PG
PGStats
Opal | Level 21

As a complement of information, I just finished writing the ExcelLoad macro that allows you to export any size of dataset to a single Excel sheet. it is located at :

PG

PG
art297
Opal | Level 21

I'm confused.  You said that a csv file would suffice.  The following, using 9.2 on Windows, creates a 1002 column file that opens in Excel 2010 without any problem:

data test;

  array item(1000);

  do i=1 to 100;

    do j=1 to 1000;

      item(j)=j;

    end;

    output;

  end;

run;

proc export data=work.test

   outfile='c:\art\wide.csv'

   dbms=csv

   replace;

run;

Linda_V
Obsidian | Level 7

I also downloaded the SAS Addin called:  Export to Microsoft Excel 2007/2010 from the SAS website.  It's working great but it's like a Wizard.  It doesn't produce code you can use in batch.  And it will only Export to a Windows environment so if you have a large file, it takes a bit.  Have a great day..

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 6 replies
  • 8135 views
  • 3 likes
  • 4 in conversation