Usage Note 20784: Tip for downloading an existing binary file when running the SAS® Stored Process Server
It is possible to download an existing binary file (or text file)
when you are running a SAS® Stored Process request with the
SAS® Stored Process Server by following the steps below.
- Create a SAS Stored Process that contains the SAS code that is shown at the bottom of this SAS Note.
- Modify the FILENAME "IN" statement by specifying the name of the file that you want to download.
- The example below downloads a PDF file. If you want to download another type of file, then you will need to specify different HTTP headers. For more information about HTTP Header records see HTTP Headers in the SAS® 9.1.3 Integration Technologies Developer's Guide.
- When you define the SAS Stored Process in your SAS® Metadata Repository, specify an "Output" type as "Streaming".
If you want to download a file that is created dynamically when you are running a SAS Stored Process, then see SAS Note 12994 .
Note: It also possible to download existing files if you have SAS/IntrNet® installed (in addition to SAS® Business
Intelligence software) by using the FILESRV program. For more information, refer to FILESRV Program documentation.
----------------------------------------------------------------
/* This example downloads an existing PDF file when */
/* running a stored process. */
*ProcessBody;
/* Modify the following statement to specify the file */
/* that you want to download. */
filename in "c:\your_directory\test.pdf";
/* Specify HTTP header records */
data _null_;
rc = stpsrv_header('Content-type','application/pdf');
rc =
stpsrv_header('Content-disposition','attachment; filename=temp.pdf');
run;
data _null_;
length data $1;
INFILE in recfm=n;
file _webout recfm=n mod;
input data $char1. @@;
put data $char1. @@;
run;
Operating System and Release Information
SAS System | SAS Integration Technologies | Microsoft Windows XP Professional | 9.1 TS1M3 | |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 | |
64-bit Enabled Solaris | 9.1 TS1M3 | |
HP-UX IPF | 9.1 TS1M3 | |
Linux | 9.1 TS1M3 | |
Linux on Itanium | 9.1 TS1M3 | |
64-bit Enabled HP-UX | 9.1 TS1M3 | |
OpenVMS Alpha | 9.1 TS1M3 | |
64-bit Enabled AIX | 9.1 TS1M3 | |
Tru64 UNIX | 9.1 TS1M3 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | |
Topic: | System Administration ==> Servers ==> Integration Technologies
|
Date Modified: | 2011-09-27 10:09:46 |
Date Created: | 2007-08-10 12:28:35 |