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.
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 ...)
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
Angela what you have given is helpful but i dont think it would work in my scenario.
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;
ods html close;
*HTML PART END;
*CSV PART START;
/* 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');
do UNTIL (EOF);
set sashelp.class end=eof;
put @01 name $12.
@17 sex $11.
*CSV PART END;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.