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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1395 views
  • 0 likes
  • 3 in conversation