Hi guys,
I was facing a similar problem as said by graham above.
I have a summary proc report which is generated first and needs to be displayed to the User.
Then a CSV file containing additional data points needs to be generated where the user will be prompeted to save the file in his desktop.
The problem is that along with the proc report the contents of the CSV are also appearing in the same HTML and a separate prompt for downloading the CSV is not getting generated.
If any one has found a workaround for this then would request you help.
Thanks
Hi
If you haven't managed to fix this drop me a line offline (email above...). I'm not working with the stored process server at my current client (yet) but could maybe point you in the right direction if I could see the code.
IIRC, I did something similar to your scenario by separating into 2 stored procs ... First stored proc runs the proc report and then used Don's macro to display a 'Continue' button after the proc report html. (The html in the button runs the second stored process which streams the CSV file ...)
HTH,
Graham.
I've written a blog post about this as well.
You can simply add the STYLE macro inside the ODS HTML statement as follows:
ods html body=_webout (no_bottom_matter) style=sasweb path=&_tmpcat (url=&_replay);
~ Angela Hall
Hi,
Angela what you have given is helpful but i dont think it would work in my scenario.
Graham,
Your idea of executing the process again will work but i wish to refrain from doing that.
A sample code that i was aiming at is as below. in my Stored process i have closed the auto generated stored process macros.
*HTML PART START;
ods html body=_webout;
proc print data=sashelp.class;
run;
ods html close;
*HTML PART END;
*CSV PART START;
data _null_;
/* Set HTTP headers */
rc = stpsrv_header('Content-type','application/vnd.ms-excel');
/* Prompt to SAVE or OPEN the attachment file named test.xls using Excel */
rc = stpsrv_header('Content-disposition','attachment; filename=test.csv');
run;
data _null_;
file _WEBOUT;
do UNTIL (EOF);
set sashelp.class end=eof;
put @01 name $12.
@17 sex $11.
;
END;
run;
*CSV PART END;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.