We have a stored process which gives excel report to users. This get stuck when we try to download a large dataset having around 500 K observations due to insufficient memory.
I am using below code, is there a way we can download such a large file using ODS.
data _null_;
rc = stpsrv_header('Content-type','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
rc = stpsrv_header('Content-disposition',"attachment; filename=test.xlsx");
run;
ods excel file = _webout style=Plateau;
libname in_lib '/data/users/report/';
proc print data=in_lib.trans_detail;
run;
ods excel close;
This is likely and ODS EXCEL issue, not an issue with the downloading.
What version of SAS are you on? I'd review this thread: https://communities.sas.com/t5/SAS-Programming/ODS-EXCEL-out-of-memory-error-with-dataset-containing...
ODS excel is great for fancy formatting, but if you're not doing anything fancy, you might be better off with PROC EXPORT or other approaches that don't have the same memory footprint.
I am able to export using PROC EXPORT and save to SAS server. How can we download this file to local machine if we don't use ODS, any alternative ?
Please see my answer to this similar question, which has an example of streaming the file using data _null_ step.
https://communities.sas.com/t5/SAS-Stored-Processes/webout-with-Proc-Export/td-p/393351
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.