@sasjs/core 4.27.10 → 4.27.13

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.
@@ -6,9 +6,6 @@
6
6
 
7
7
  %put %mf_existVarList(sashelp.class, age sex name dummyvar);
8
8
 
9
- <h4> SAS Macros </h4>
10
- @li mf_abort.sas
11
-
12
9
  @param libds 2 part dataset or view reference
13
10
  @param varlist space separated variable names
14
11
 
package/base/mp_abort.sas CHANGED
@@ -63,7 +63,8 @@
63
63
  , mode=REGULAR
64
64
  )/*/STORE SOURCE*/;
65
65
 
66
- %global sysprocessmode sysprocessname;
66
+ %global sysprocessmode sysprocessname sasjs_stpsrv_header_loc;
67
+ %local fref fid i;
67
68
 
68
69
  %if not(%eval(%unquote(&iftrue))) %then %return;
69
70
 
@@ -157,8 +158,8 @@
157
158
  %end;
158
159
 
159
160
  %if %symexist(SYS_JES_JOB_URI) %then %do;
160
- /* setup webout */
161
- OPTIONS NOBOMFILE;
161
+ /* setup webout for Viya */
162
+ options nobomfile;
162
163
  %if "X&SYS_JES_JOB_URI.X"="XX" %then %do;
163
164
  filename _webout temp lrecl=999999 mod;
164
165
  %end;
@@ -167,11 +168,24 @@
167
168
  name="_webout.json" lrecl=999999 mod;
168
169
  %end;
169
170
  %end;
171
+ %else %if %sysfunc(filename(fref,&sasjs_stpsrv_header_loc))=0 %then %do;
172
+ options nobomfile;
173
+ /* set up http header for SASjs Server */
174
+ %let fid=%sysfunc(fopen(&fref,A));
175
+ %if &fid=0 %then %do;
176
+ %put %str(ERR)OR: %sysfunc(sysmsg());
177
+ %return;
178
+ %end;
179
+ %let rc=%sysfunc(fput(&fid,%str(Content-Type: application/json)));
180
+ %let rc=%sysfunc(fwrite(&fid));
181
+ %let rc=%sysfunc(fclose(&fid));
182
+ %let rc=%sysfunc(filename(&fref));
183
+ %end;
170
184
 
171
185
  /* send response in SASjs JSON format */
172
186
  data _null_;
173
187
  file _webout mod lrecl=32000 encoding='utf-8';
174
- length msg syswarningtext syserrortext $32767 ;
188
+ length msg syswarningtext syserrortext $32767 mode $10 ;
175
189
  sasdatetime=datetime();
176
190
  msg=symget('msg');
177
191
  %if &logline>0 %then %do;
@@ -187,7 +201,8 @@
187
201
  msg=cats('"',msg,'"');
188
202
  if symexist('_debug') then debug=quote(trim(symget('_debug')));
189
203
  else debug='""';
190
- put '>>weboutBEGIN<<';
204
+ if symget('sasjsprocessmode')='Stored Program' then mode='SASJS';
205
+ if mode ne 'SASJS' then put '>>weboutBEGIN<<';
191
206
  put '{"SYSDATE" : "' "&SYSDATE" '"';
192
207
  put ',"SYSTIME" : "' "&SYSTIME" '"';
193
208
  put ',"sasjsAbort" : [{';
@@ -219,8 +234,8 @@
219
234
  syswarningtext=quote(trim(symget('syswarningtext')));
220
235
  put ",""SYSWARNINGTEXT"" : " syswarningtext;
221
236
  put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
222
- put "}" @;
223
- put '>>weboutEND<<';
237
+ put "}" ;
238
+ if mode ne 'SASJS' then put '>>weboutEND<<';
224
239
  run;
225
240
 
226
241
  %put _all_;
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.13.0"
37
37
  },
38
- "version": "4.27.10"
38
+ "version": "4.27.13"
39
39
  }