@sasjs/core 4.45.7 → 4.45.8
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/package.json +1 -1
- package/server/ms_runstp.sas +22 -6
- package/server/ms_testservice.sas +10 -23
package/package.json
CHANGED
package/server/ms_runstp.sas
CHANGED
|
@@ -39,8 +39,9 @@
|
|
|
39
39
|
|
|
40
40
|
<h4> SAS Macros </h4>
|
|
41
41
|
@li mf_getuniquefileref.sas
|
|
42
|
-
@li
|
|
42
|
+
@li mf_getuniquename.sas
|
|
43
43
|
@li mp_abort.sas
|
|
44
|
+
@li mp_chop.sas
|
|
44
45
|
|
|
45
46
|
**/
|
|
46
47
|
|
|
@@ -153,7 +154,10 @@ run;
|
|
|
153
154
|
run;
|
|
154
155
|
%end;
|
|
155
156
|
|
|
156
|
-
|
|
157
|
+
%local resp_path;
|
|
158
|
+
%let resp_path=%sysfunc(pathname(work))/%mf_getuniquename();
|
|
159
|
+
filename &outref "&resp_path" lrecl=32767;
|
|
160
|
+
|
|
157
161
|
/* prepare request*/
|
|
158
162
|
proc http method='POST' headerin=&authref in=&mainref out=&outref
|
|
159
163
|
url="&_sasjs_apiserverurl.&_sasjs_apipath?_program=&pgm%str(&)_debug=131";
|
|
@@ -161,6 +165,7 @@ proc http method='POST' headerin=&authref in=&mainref out=&outref
|
|
|
161
165
|
debug level=2;
|
|
162
166
|
%end;
|
|
163
167
|
run;
|
|
168
|
+
|
|
164
169
|
%if (&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 201)
|
|
165
170
|
or &mdebug=1
|
|
166
171
|
%then %do;
|
|
@@ -176,11 +181,22 @@ or &mdebug=1
|
|
|
176
181
|
options &optval;
|
|
177
182
|
|
|
178
183
|
%if &outlogds ne _null_ or &mdebug=1 %then %do;
|
|
179
|
-
%local
|
|
180
|
-
%let
|
|
181
|
-
|
|
184
|
+
%local matchstr chopout;
|
|
185
|
+
%let matchstr=SASJS_LOGS_SEPARATOR_163ee17b6ff24f028928972d80a26784;
|
|
186
|
+
%let chopout=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop);
|
|
187
|
+
|
|
188
|
+
%mp_chop("&resp_path"
|
|
189
|
+
,matchvar=matchstr
|
|
190
|
+
,keep=LAST
|
|
191
|
+
,matchpoint=END
|
|
192
|
+
,outfile="&chopout"
|
|
193
|
+
,mdebug=&mdebug
|
|
194
|
+
)
|
|
195
|
+
|
|
182
196
|
data &outlogds;
|
|
183
|
-
|
|
197
|
+
infile "&chopout" lrecl=2000;
|
|
198
|
+
length line $2000;
|
|
199
|
+
line=_infile_;
|
|
184
200
|
%if &mdebug=1 %then %do;
|
|
185
201
|
putlog line=;
|
|
186
202
|
%end;
|
|
@@ -108,47 +108,34 @@ run;
|
|
|
108
108
|
)
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
/*
|
|
112
|
-
|
|
113
|
-
%
|
|
114
|
-
%let
|
|
115
|
-
%let matchstr2=},"log":[{;
|
|
116
|
-
%let chopout1=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop1);
|
|
117
|
-
%let chopout2=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop2);
|
|
111
|
+
/* chop out JSON section */
|
|
112
|
+
%local matchstr chopout;
|
|
113
|
+
%let matchstr=SASJS_LOGS_SEPARATOR_163ee17b6ff24f028928972d80a26784;
|
|
114
|
+
%let chopout=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop);
|
|
118
115
|
|
|
119
116
|
%mp_chop("%sysfunc(pathname(&fref1,F))"
|
|
120
|
-
,matchvar=
|
|
121
|
-
,keep=LAST
|
|
122
|
-
,matchpoint=END
|
|
123
|
-
,offset=-1
|
|
124
|
-
,outfile="&chopout1"
|
|
125
|
-
,mdebug=&mdebug
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
%mp_chop("&chopout1"
|
|
129
|
-
,matchvar=matchstr2
|
|
117
|
+
,matchvar=matchstr
|
|
130
118
|
,keep=FIRST
|
|
131
119
|
,matchpoint=START
|
|
132
|
-
,offset
|
|
133
|
-
,outfile="&
|
|
120
|
+
,offset=-1
|
|
121
|
+
,outfile="&chopout"
|
|
134
122
|
,mdebug=&mdebug
|
|
135
123
|
)
|
|
136
124
|
|
|
137
125
|
%if &outlib ne 0 %then %do;
|
|
138
|
-
libname &outlib json "&
|
|
126
|
+
libname &outlib json "&chopout";
|
|
139
127
|
%end;
|
|
140
128
|
%if &outref ne 0 %then %do;
|
|
141
|
-
filename &outref "&
|
|
129
|
+
filename &outref "&chopout";
|
|
142
130
|
%end;
|
|
143
131
|
|
|
144
132
|
%if &mdebug=0 %then %do;
|
|
145
133
|
filename &webref clear;
|
|
146
134
|
filename &fref1 clear;
|
|
147
|
-
filename &fref2 clear;
|
|
148
135
|
%end;
|
|
149
136
|
%else %do;
|
|
150
137
|
%put &sysmacroname exit vars:;
|
|
151
138
|
%put _local_;
|
|
152
139
|
%end;
|
|
153
140
|
|
|
154
|
-
%mend ms_testservice;
|
|
141
|
+
%mend ms_testservice;
|