@sasjs/core 4.27.11 → 4.27.14

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,6 +168,19 @@
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_;
@@ -187,9 +201,7 @@
187
201
  msg=cats('"',msg,'"');
188
202
  if symexist('_debug') then debug=quote(trim(symget('_debug')));
189
203
  else debug='""';
190
- if symexist('sasjsprocessmode')
191
- and symget('sasjsprocessmode')='Stored Program'
192
- then mode='SASJS';
204
+ if symget('sasjsprocessmode')='Stored Program' then mode='SASJS';
193
205
  if mode ne 'SASJS' then put '>>weboutBEGIN<<';
194
206
  put '{"SYSDATE" : "' "&SYSDATE" '"';
195
207
  put ',"SYSTIME" : "' "&SYSTIME" '"';
@@ -222,7 +234,7 @@
222
234
  syswarningtext=quote(trim(symget('syswarningtext')));
223
235
  put ",""SYSWARNINGTEXT"" : " syswarningtext;
224
236
  put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
225
- put "}" @;
237
+ put "}" ;
226
238
  if mode ne 'SASJS' then put '>>weboutEND<<';
227
239
  run;
228
240
 
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.13.0"
37
37
  },
38
- "version": "4.27.11"
38
+ "version": "4.27.14"
39
39
  }
@@ -41,6 +41,17 @@
41
41
  )
42
42
 
43
43
  %local fref0 fref1 libref optval rc msg;
44
+
45
+ %if %sysget(MODE)=desktop %then %do;
46
+ /* groups api does not exist in desktop mode */
47
+ data &outds;
48
+ length NAME $32 DESCRIPTION $64. GROUPID 8;
49
+ call missing (of _all_);
50
+ stop;
51
+ run;
52
+ %return;
53
+ %end;
54
+
44
55
  %let fref0=%mf_getuniquefileref();
45
56
  %let fref1=%mf_getuniquefileref();
46
57
  %let libref=%mf_getuniquelibref();
@@ -89,7 +100,7 @@ run;
89
100
 
90
101
  %mp_abort(
91
102
  iftrue=(&syscc ne 0)
92
- ,mac=ms_getusers.sas
103
+ ,mac=ms_getgroups.sas
93
104
  ,msg=%str(Issue reading response JSON)
94
105
  )
95
106