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...
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.