Hi, My suggestion is to export using the XLSX engine on the libname statement. I've noticed, for the same data, xlsx files are smaller than csv files, however csv files can be compressed to be much smaller than xlsx, xlsx files compress but don't get much smaller than the original. Here is some code, it could be improved but it's a start… For example, as it is written now, it has to read your big 8M daset 10 times, that can be fixed. I’m just trying to show that you can write data directly from a data step to excel where you have all the data step statement available to you. Good luck… /*This will create one big excel file with 8-10 tabs;*/ /*in reality, you should break it up into multiple files b/c 8M rows for*/ /*one excel file might be too big, depending on number of columns*/ /*define libname with xlsx engine, including the excle file name and .xlsx*/ libname outFile XLSX "/put your Unix path here – It is Case Sensitive/ExcelFileName.xlsx"; /*Define macro*/ %macro WriteOutData; /* loop thru 10 times*/ /* and put 1M rows on each tab*/ /* careful, anyting over 10M rows will not get output (as written now)*/ %do i=1 %to 10; data outFile.partial_&i; set myBigFile; /*output 1M rows per tab*/ if (&i-1)*1000000 < _n_ <= &i*1000000 then output outFile.partial_&i; run; %end; %mend WriteOutData; /*call macro - note no semicolon is needed*/ %WriteOutData /*clear the libname*/ libname outFile;
... View more