35 %let contentype=%upcase(&contenttype);
36 %local platform; %let platform=%mf_getplatform();
38 %
if &contentype=ZIP %then %
do;
39 %
if &platform=SASMETA %then %
do;
41 rc=stpsrv_header(
'Content-type',
'application/zip');
42 rc=stpsrv_header(
'Content-disposition',
"attachment; filename=&outname");
45 %
else %
if &platform=SASVIYA %then %
do;
46 filename _webout filesrvc parenturi=
"&SYS_JES_JOB_URI" name=
'_webout.zip'
47 contenttype=
'application/zip'
48 contentdisp=
"attachment; filename=&outname";
51 %
else %
if &contentype=EXCEL %then %
do;
53 %
if &platform=SASMETA %then %
do;
55 rc=stpsrv_header(
'Content-type',
'application/vnd.ms-excel');
56 rc=stpsrv_header(
'Content-disposition',
"attachment; filename=&outname");
59 %
else %
if &platform=SASVIYA %then %
do;
60 filename _webout filesrvc parenturi=
"&SYS_JES_JOB_URI" name=
'_webout.xls'
61 contenttype=
'application/vnd.ms-excel'
62 contentdisp=
"attachment; filename=&outname";
65 %
else %
if &contentype=XLSX %then %
do;
66 %
if &platform=SASMETA %then %
do;
68 rc=stpsrv_header(
'Content-type',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
69 rc=stpsrv_header(
'Content-disposition',
"attachment; filename=&outname");
72 %
else %
if &platform=SASVIYA %then %
do;
73 filename _webout filesrvc parenturi=
"&SYS_JES_JOB_URI" name=
'_webout.xls'
74 contenttype=
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
75 contentdisp=
"attachment; filename=&outname";
78 %
else %
if &contentype=TEXT %then %
do;
79 %
if &platform=SASMETA %then %
do;
81 rc=stpsrv_header(
'Content-type',
'application/text');
82 rc=stpsrv_header(
'Content-disposition',
"attachment; filename=&outname");
85 %
else %
if &platform=SASVIYA %then %
do;
86 filename _webout filesrvc parenturi=
"&SYS_JES_JOB_URI" name=
'_webout.txt'
87 contenttype=
'application/text'
88 contentdisp=
"attachment; filename=&outname";
91 %
else %
if &contentype=CSV %then %
do;
92 %
if &platform=SASMETA %then %
do;
94 rc=stpsrv_header(
'Content-type',
'application/csv');
95 rc=stpsrv_header(
'Content-disposition',
"attachment; filename=&outname");
98 %
else %
if &platform=SASVIYA %then %
do;
99 filename _webout filesrvc parenturi=
"&SYS_JES_JOB_URI" name=
'_webout.txt'
100 contenttype=
'application/csv'
101 contentdisp=
"attachment; filename=&outname";
104 %
else %
if &contentype=HTML %then %
do;
105 %
if &platform=SASVIYA %then %
do;
106 filename _webout filesrvc parenturi=
"&SYS_JES_JOB_URI" name=
"_webout.json"
107 contenttype=
"text/html";
111 %put %str(ERR)OR: Content Type &contenttype NOT SUPPORTED by &sysmacroname!;
115 %
if &inref ne 0 %then %
do;
116 %mp_binarycopy(inref=&inref,outref=_webout)
119 %mp_binarycopy(inloc=
"&inloc",outref=_webout)