Can we use Proc Export for more than 256 columns?

Reply
Contributor
Posts: 30

Can we use Proc Export for more than 256 columns?

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

Respected Advisor
Posts: 3,124

Re: Can we use Proc Export for more than 256 columns?

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

Contributor
Posts: 30

Re: Can we use Proc Export for more than 256 columns?

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

Respected Advisor
Posts: 4,644

Re: Can we use Proc Export for more than 256 columns?

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
Respected Advisor
Posts: 4,644

Re: Can we use Proc Export for more than 256 columns?

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
PROC Star
Posts: 7,360

Re: Can we use Proc Export for more than 256 columns?

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;

Contributor
Posts: 30

Re: Can we use Proc Export for more than 256 columns?

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

Ask a Question
Discussion stats
  • 6 replies
  • 3401 views
  • 3 likes
  • 4 in conversation