BookmarkSubscribeRSS Feed
gamotte
Rhodochrosite | Level 12

Hello,

 

I would like a stored process to stream a binary file (zip archive containing text files) to _webout.

 

filename arch ZIP "&path_to_file./myArchive.zip";

data _NULL_;
    set sashelp.class;
    file arch(class.txt);
    put _ALL_;
run;

data _null_;    
    rc=appsrv_header('Content-type:','application/zip');
    rc=appsrv_header('Content-disposition',"attachment; filename=myArchive.zip");
run;

/* Insert missing code here */

proc stream doesn't handle binary streams and a data step with put _INFILE_ won't work either.

Both result in an insufficient authorization error message.

 

Is there a way to stream binary files in SAS ?

 

Thanks.

 

 

1 REPLY 1
gamotte
Rhodochrosite | Level 12

Hello,

 

I could solve my problem with a data step. My mistake was to use the arch fileref to access the file in the data step.

With a new filename statement and using the new fileref in the datastep, i can now download my zip file.

 

Thanks for reading.

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
  • 1 reply
  • 318 views
  • 0 likes
  • 1 in conversation