@sasjs/core 4.9.4 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/mp_streamfile.sas +39 -7
- package/package.json +1 -1
package/base/mp_streamfile.sas
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<h4> SAS Macros </h4>
|
|
24
24
|
@li mf_getplatform.sas
|
|
25
|
+
@li mfs_httpheader.sas
|
|
25
26
|
@li mp_binarycopy.sas
|
|
26
27
|
|
|
27
28
|
@author Allan Bowe
|
|
@@ -55,7 +56,7 @@ data _null_;
|
|
|
55
56
|
run;
|
|
56
57
|
|
|
57
58
|
%if &contentype=CSV %then %do;
|
|
58
|
-
%if (&platform=SASMETA and &streamweb=1)
|
|
59
|
+
%if (&platform=SASMETA and &streamweb=1) %then %do;
|
|
59
60
|
data _null_;
|
|
60
61
|
rc=stpsrv_header('Content-type','application/csv');
|
|
61
62
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
|
@@ -66,10 +67,14 @@ run;
|
|
|
66
67
|
contenttype='application/csv'
|
|
67
68
|
contentdisp="attachment; filename=&outname";
|
|
68
69
|
%end;
|
|
70
|
+
%else %if &platform=SASJS %then %do;
|
|
71
|
+
%mfs_httpheader(Content-type,application/csv)
|
|
72
|
+
%mfs_httpheader(Content-disposition,%str(attachment; filename=&outname))
|
|
73
|
+
%end;
|
|
69
74
|
%end;
|
|
70
75
|
%else %if &contentype=EXCEL %then %do;
|
|
71
76
|
/* suitable for XLS format */
|
|
72
|
-
%if (&platform=SASMETA and &streamweb=1)
|
|
77
|
+
%if (&platform=SASMETA and &streamweb=1) %then %do;
|
|
73
78
|
data _null_;
|
|
74
79
|
rc=stpsrv_header('Content-type','application/vnd.ms-excel');
|
|
75
80
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
|
@@ -80,9 +85,13 @@ run;
|
|
|
80
85
|
contenttype='application/vnd.ms-excel'
|
|
81
86
|
contentdisp="attachment; filename=&outname";
|
|
82
87
|
%end;
|
|
88
|
+
%else %if &platform=SASJS %then %do;
|
|
89
|
+
%mfs_httpheader(Content-type,application/vnd.ms-excel)
|
|
90
|
+
%mfs_httpheader(Content-disposition,%str(attachment; filename=&outname))
|
|
91
|
+
%end;
|
|
83
92
|
%end;
|
|
84
93
|
%else %if &contentype=GIF or &contentype=JPEG or &contentype=PNG %then %do;
|
|
85
|
-
%if (&platform=SASMETA and &streamweb=1)
|
|
94
|
+
%if (&platform=SASMETA and &streamweb=1) %then %do;
|
|
86
95
|
data _null_;
|
|
87
96
|
rc=stpsrv_header('Content-type',"image/%lowcase(&contenttype)");
|
|
88
97
|
run;
|
|
@@ -91,15 +100,21 @@ run;
|
|
|
91
100
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI"
|
|
92
101
|
contenttype="image/%lowcase(&contenttype)";
|
|
93
102
|
%end;
|
|
103
|
+
%else %if &platform=SASJS %then %do;
|
|
104
|
+
%mfs_httpheader(Content-type,image/%lowcase(&contenttype))
|
|
105
|
+
%end;
|
|
94
106
|
%end;
|
|
95
107
|
%else %if &contentype=HTML %then %do;
|
|
96
108
|
%if &platform=SASVIYA %then %do;
|
|
97
109
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name="_webout.json"
|
|
98
110
|
contenttype="text/html";
|
|
99
111
|
%end;
|
|
112
|
+
%else %if &platform=SASJS %then %do;
|
|
113
|
+
%mfs_httpheader(Content-type,text/html)
|
|
114
|
+
%end;
|
|
100
115
|
%end;
|
|
101
116
|
%else %if &contentype=TEXT %then %do;
|
|
102
|
-
%if (&platform=SASMETA and &streamweb=1)
|
|
117
|
+
%if (&platform=SASMETA and &streamweb=1) %then %do;
|
|
103
118
|
data _null_;
|
|
104
119
|
rc=stpsrv_header('Content-type','application/text');
|
|
105
120
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
|
@@ -110,9 +125,13 @@ run;
|
|
|
110
125
|
contenttype='application/text'
|
|
111
126
|
contentdisp="attachment; filename=&outname";
|
|
112
127
|
%end;
|
|
128
|
+
%else %if &platform=SASJS %then %do;
|
|
129
|
+
%mfs_httpheader(Content-type,application/text)
|
|
130
|
+
%mfs_httpheader(Content-disposition,%str(attachment; filename=&outname))
|
|
131
|
+
%end;
|
|
113
132
|
%end;
|
|
114
133
|
%else %if &contentype=WOFF or &contentype=WOFF2 or &contentype=TTF %then %do;
|
|
115
|
-
%if (&platform=SASMETA and &streamweb=1)
|
|
134
|
+
%if (&platform=SASMETA and &streamweb=1) %then %do;
|
|
116
135
|
data _null_;
|
|
117
136
|
rc=stpsrv_header('Content-type',"font/%lowcase(&contenttype)");
|
|
118
137
|
run;
|
|
@@ -121,9 +140,12 @@ run;
|
|
|
121
140
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI"
|
|
122
141
|
contenttype="font/%lowcase(&contenttype)";
|
|
123
142
|
%end;
|
|
143
|
+
%else %if &platform=SASJS %then %do;
|
|
144
|
+
%mfs_httpheader(Content-type,font/%lowcase(&contenttype))
|
|
145
|
+
%end;
|
|
124
146
|
%end;
|
|
125
147
|
%else %if &contentype=XLSX %then %do;
|
|
126
|
-
%if (&platform=SASMETA and &streamweb=1)
|
|
148
|
+
%if (&platform=SASMETA and &streamweb=1) %then %do;
|
|
127
149
|
data _null_;
|
|
128
150
|
rc=stpsrv_header('Content-type',
|
|
129
151
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
|
@@ -136,9 +158,15 @@ run;
|
|
|
136
158
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
137
159
|
contentdisp="attachment; filename=&outname";
|
|
138
160
|
%end;
|
|
161
|
+
%else %if &platform=SASJS %then %do;
|
|
162
|
+
%mfs_httpheader(Content-type
|
|
163
|
+
,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
|
164
|
+
)
|
|
165
|
+
%mfs_httpheader(Content-disposition,%str(attachment; filename=&outname))
|
|
166
|
+
%end;
|
|
139
167
|
%end;
|
|
140
168
|
%else %if &contentype=ZIP %then %do;
|
|
141
|
-
%if (&platform=SASMETA and &streamweb=1)
|
|
169
|
+
%if (&platform=SASMETA and &streamweb=1) %then %do;
|
|
142
170
|
data _null_;
|
|
143
171
|
rc=stpsrv_header('Content-type','application/zip');
|
|
144
172
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
|
@@ -149,6 +177,10 @@ run;
|
|
|
149
177
|
contenttype='application/zip'
|
|
150
178
|
contentdisp="attachment; filename=&outname";
|
|
151
179
|
%end;
|
|
180
|
+
%else %if &platform=SASJS %then %do;
|
|
181
|
+
%mfs_httpheader(Content-type,application/zip)
|
|
182
|
+
%mfs_httpheader(Content-disposition,%str(attachment; filename=&outname))
|
|
183
|
+
%end;
|
|
152
184
|
%end;
|
|
153
185
|
%else %do;
|
|
154
186
|
%put %str(ERR)OR: Content Type &contenttype NOT SUPPORTED by &sysmacroname!;
|
package/package.json
CHANGED