BookmarkSubscribeRSS Feed
juheej
Calcite | Level 5

Hi,

 

I need help with exporting data on SAS to excel.

 

The data is in SAS libraries and is accessed through SAS studio via WRDS database.

 

Further, the one of the data sets has close to 1351499 rows which is in excess of the number of rows in a single excel sheet.

 

Please guide has to how can I export this data to excel and save it on my PC.

 

The pics of the data view on SAS are attached for reference.

 

Best regards

3 REPLIES 3
Kurt_Bremser
Super User

Keep your data in SAS, where it belongs. Excel is useless for mass data. If you want copies of data for safe-keeping and external (non-SAS) access, export to csv and keep those files on your desktop.

ballardw
Super User

@juheej wrote:

 

Further, the one of the data sets has close to 1351499 rows which is in excess of the number of rows in a single excel sheet.

 


That is just one of the many reasons NOT to use Excel for data: file size limitations.

 

And if you follow @Kurt_Bremser's suggestion to use CSV then do not ever save the CSV if you open it with Excel. The result will truncate your data and may actually change values.

SuryaKiran
Meteorite | Level 14

I agree with @Kurt_Bremser , excel is not the right tool to handle large amount of data. If you still wish to go with it then I would suggest group the data with size (50k or so) & create excel with multiple sheets per group, so that each sheet will hold just 50k and not need to worry if you have large amount of data (This is not recommended way but a work around if you want to have large data in excel).

 

ods excel file='H:\SAS\test\groups.xlsx' ;
proc print data=mydata;
by group; /* create this variable to group records */
run;
ods excel close;

 

Thanks,
Suryakiran

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 695 views
  • 0 likes
  • 4 in conversation