@sasjs/core 4.27.9 → 4.27.12

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.
Files changed (2) hide show
  1. package/base/mp_abort.sas +25 -9
  2. package/package.json +1 -1
package/base/mp_abort.sas CHANGED
@@ -22,7 +22,7 @@
22
22
  include, and then call \%mp_abort(mode=INCLUDE) from the source program (ie,
23
23
  OUTSIDE of the top-parent macro).
24
24
  The soft abort has also been found to be ineffective in 9.4m6 windows
25
- environments.
25
+ environments and above, so in these cases, endsas is used.
26
26
 
27
27
 
28
28
  @param mac= (mp_abort.sas) To contain the name of the calling macro. Do not
@@ -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,7 +158,7 @@
157
158
  %end;
158
159
 
159
160
  %if %symexist(SYS_JES_JOB_URI) %then %do;
160
- /* setup webout */
161
+ /* setup webout for Viya */
161
162
  OPTIONS NOBOMFILE;
162
163
  %if "X&SYS_JES_JOB_URI.X"="XX" %then %do;
163
164
  filename _webout temp lrecl=999999 mod;
@@ -167,11 +168,23 @@
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
+ /* set up http header for SASjs Server */
173
+ %let fid=%sysfunc(fopen(&fref,A));
174
+ %if &fid=0 %then %do;
175
+ %put %str(ERR)OR: %sysfunc(sysmsg());
176
+ %return;
177
+ %end;
178
+ %let rc=%sysfunc(fput(&fid,%str(Content-Type: application/json)));
179
+ %let rc=%sysfunc(fwrite(&fid));
180
+ %let rc=%sysfunc(fclose(&fid));
181
+ %let rc=%sysfunc(filename(&fref));
182
+ %end;
170
183
 
171
184
  /* send response in SASjs JSON format */
172
185
  data _null_;
173
186
  file _webout mod lrecl=32000 encoding='utf-8';
174
- length msg syswarningtext syserrortext $32767 ;
187
+ length msg syswarningtext syserrortext $32767 mode $10 ;
175
188
  sasdatetime=datetime();
176
189
  msg=symget('msg');
177
190
  %if &logline>0 %then %do;
@@ -187,7 +200,8 @@
187
200
  msg=cats('"',msg,'"');
188
201
  if symexist('_debug') then debug=quote(trim(symget('_debug')));
189
202
  else debug='""';
190
- put '>>weboutBEGIN<<';
203
+ if symget('sasjsprocessmode')='Stored Program' then mode='SASJS';
204
+ if mode ne 'SASJS' then put '>>weboutBEGIN<<';
191
205
  put '{"SYSDATE" : "' "&SYSDATE" '"';
192
206
  put ',"SYSTIME" : "' "&SYSTIME" '"';
193
207
  put ',"sasjsAbort" : [{';
@@ -219,8 +233,8 @@
219
233
  syswarningtext=quote(trim(symget('syswarningtext')));
220
234
  put ",""SYSWARNINGTEXT"" : " syswarningtext;
221
235
  put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
222
- put "}" @;
223
- put '>>weboutEND<<';
236
+ put "}" ;
237
+ if mode ne 'SASJS' then put '>>weboutEND<<';
224
238
  run;
225
239
 
226
240
  %put _all_;
@@ -231,8 +245,10 @@
231
245
  rc=stpsrvset('program error', 0);
232
246
  call symputx("syscc",0,"g");
233
247
  run;
234
- %if &sysscp=WIN and "%substr(&sysvlong. ,1,9)"="9.04.01M6" %then %do;
235
- /* skip approach (below) does not work on this OS / version combo */
248
+ %if &sysscp=WIN
249
+ and "%substr(%str(&sysvlong ),1,8)"="9.04.01M"
250
+ and "%substr(%str(&sysvlong ),9,1)">"5" %then %do;
251
+ /* skip approach (below) does not work in windows m6+ envs */
236
252
  endsas;
237
253
  %end;
238
254
  %else %do;
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.13.0"
37
37
  },
38
- "version": "4.27.9"
38
+ "version": "4.27.12"
39
39
  }