LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2000, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 30 Mar 2000 09:40:31 -0600
Reply-To:     "Dwight Eggers (EUS)" <EUSDEE1@AM1.ERICSSON.SE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Dwight Eggers (EUS)" <EUSDEE1@AM1.ERICSSON.SE>
Subject:      Re: Intrnet: copy binary with mime-type prefix
Content-Type: text/plain; charset="iso-8859-1"

I received some useful help from Howard Wright for doing a binary copy within a data step. Since he did not post it to the news group, I am sharing a solution to my original query that appears to be working. Howard's solution involves the most elementary form of the INPUT statement -- without any variable specifications -- and the _INFILE_ keyword in the PUT statement.

The macro that I developed for passing a binary file, with a mime-type specification appended as a header, to a client application from an Intrnet application server follows. My remaining concern is whether the MAXSIZE specification is sufficient to handle the general situations.

Dwight Eggers

%macro bincopy (mimetype, filename, outfile=_webout, maxsize=8192);

%* Download a binary file to the client through the browser with the ; %* appropriate mime-type specification to allow the file to be opened ; %* in the target application. ;

%* Needed parameters are the following: ; %* mimetype -- Mime type, for example: application/vnd.ms-excel; %* filename -- name of file on application server.;

data _null_; file &outfile lrecl=&maxsize; infile "&filename" lrecl=&maxsize ;

if _n_=1 then do; put "Content-type: &mimetype" ; put; end;

input; put _infile_;

run;

%mend bincopy;


Back to: Top of message | Previous page | Main SAS-L page