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

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