Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mp_streamfile.sas File Reference

Streams a file to _webout according to content type. More...

Go to the source code of this file.

Detailed Description

Will set headers using appropriate functions (SAS 9 vs Viya) and send content as a binary stream.

Usage:

filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;

%mp_streamfile(contenttype=csv,inloc=/some/where.txt,outname=myfile.txt)

Dependencies

Parameters
contenttype=Either TEXT, ZIP, CSV, EXCEL (default TEXT)
inloc=/path/to/file.ext to be sent
outname=the name of the file, as downloaded by the browser
Author
Allan Bowe @source https://github.com/sasjs/core

Definition in file mp_streamfile.sas.