BookmarkSubscribeRSS Feed
MarcTC
Obsidian | Level 7
I am building a SPWA based web application. I want to add a download link to the web page for users to download the data to an Excel spreadsheet like "Donwload to Spreadsheet" link shown in the following Yahoo Historical Stock Price page:
http://finance.yahoo.com/q/hp?s=^GSPC

Any hints are appreciated!
3 REPLIES 3
Vince_SAS
Rhodochrosite | Level 12
You will find many good references if you go to http://support.sas.com and then search for:

download csv

The key is to create to a streaming stored process that sets the appropriate MIME headers. Give this (untested) code a try:

[pre]
%let RV=%sysfunc(appsrv_header(Content-type, application/vnd.ms-excel));
%let RV=%sysfunc(appsrv_header(Content-disposition, %str(attachment; filename=temp.csv)));

ods listing close;
ods csv file=_webout;
proc print data=sashelp.class; run; quit;
ods csv close;
[/pre]

Vince DelGobbo
SAS R&D
Attyslogin
Obsidian | Level 7

 what if that file is an image ? 

 

 

how to download ?

Vince_SAS
Rhodochrosite | Level 12

@Attyslogin - can you provide more details on what you want to do?

 

Vince DelGobbo

SAS R&D

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1797 views
  • 0 likes
  • 3 in conversation