I need SAS code to successfully export 2 million records (2 million rows X 12 columns ) in Excel file
@Rhino84 wrote:
I need SAS code to successfully export 2 million records (2 million rows X 12 columns ) in Excel file
Yes, you can use PROC EXPORT to create a CSV file. You just won't be able to open it in Excel.
As Reeza points out, Excel can hold only about 1 million rows per sheet. You could export with multiple passes into multiple sheets. Something like:
filename out "c:\project\bigexcel.xlsx";
proc export data=bigfile(obs=1000000)
dbms=xlsx
outfile=out replace;
sheet="First million";
run;
proc export data=bigfile(fistobs=1000001)
dbms=xlsx
outfile=out replace;
sheet="Second million";
run;
But...this is probably a terrible use for Excel and data storage. But sometimes that's what our clients ask for...
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.