BookmarkSubscribeRSS Feed
Benbo123321
Calcite | Level 5

SAS newbie here.  I'm trying to export a SAS dataset of approximately 40 million observations and 110 variables  so that it can be read by someone with Excel or Access.

I really want to avoid making 21 excel workbooks with 1,048,575 records and 1 workbook of 154,150 records.

Also, how do I retain the header row for each subset? 

Thanks in advance.

Ben

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Why on earth would you want to put 40mil rows out to Excel??  I doubt even the most ethusiatic person is going to want to see that kind of data.

You *could* do it:

ods tagsets.excelxp file="...xls";

ods tagsets.excelxp (sheet="Sheet1" auto_Filter=yes);

proc report... first observations....;

ods tagset.excelxp (sheet="Sheet2"...

However you are pretty much going to break it.  40 million records is going to be a huge gigabyte spanning monstrosity which Excel probably wont even be able to open.

art297
Opal | Level 21

I think the answer will depend upon how the new workbook(s)/worksheet(s) will be used.  Since Excel can handle 1,048,576 rows with 16,384 columns each, you could put 148 observations on each row, and thus end up only using up 270,271 rows.

Benbo123321
Calcite | Level 5

Would Access be better? how would I go about doing that?

Ben

art297
Opal | Level 21

I think that Access would be limited to 2GB and no fields could be greater than 255 characters. If you exceed those limitations, than no.

If you are within those limits, and license SAS/Access for PC File Formats, you might be able to get away with something as simple as proc export.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

It really depends on what you intend doing with the data.  As I always say Excel is not designed for <insert your task here> in any way shape or form.  Then fact that it can be shoehorned in just shows how bad and dangerous it is.

If you are looking to store that data, then use database or data warehouse, there are free ones out there and they should easily deal with that amount of data.  For special needs then choose a proprietary one and get a license.  Trust me DB's are designed for storing data, use a tool for its purpose.

If you are analysing the data then keep it within SAS.  Produce summarised reports from it to send out.

For any other needs see what you can do to minimise the output.  For instance in my industry we capture subject data.  It wouldn't be beneficial to just dump all the data out to Excel, so Profiles are generated.  A nice structured layout per subject so reviewers can actually see the data easily.  If someone sent me a spreadsheet with 40 mil rows, or 16k columns I would start sharpening the trusty pitchfork :smileydevil:

Also, final note.  If you export the data via tagset to Excel, it wont really matter so much what Excel's limitations are, XML is the most verbose transfer format around so your file size will be vast.

ballardw
Super User

I'm not sure on the current limits of a single MS Access table but the process would be:

Export to CSV

open Access

tell it to import the CSV.

Or if you have the correct PC/Files modules you can use Proc Export with an appropriate DBMS, OUTFILE and OUTTABELE options.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4304 views
  • 5 likes
  • 4 in conversation