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...
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.