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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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