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

Innovate_SAS_Blue.png

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. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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