@sasjs/core 4.27.8 → 4.27.11
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_abort.sas +40 -24
- package/meta/mm_getfoldertree.sas +3 -5
- package/package.json +1 -1
package/base/mp_abort.sas
CHANGED
|
@@ -15,16 +15,20 @@
|
|
|
15
15
|
recognise this and fetch the log of the parent session instead)
|
|
16
16
|
@li STP environments must finish cleanly to avoid the log being sent to
|
|
17
17
|
_webout. To assist with this, we also run stpsrvset('program error', 0)
|
|
18
|
-
and set SYSCC=0.
|
|
18
|
+
and set SYSCC=0.
|
|
19
|
+
Where possible, we take a unique "soft abort" approach - we open a macro
|
|
19
20
|
but don't close it! This works everywhere EXCEPT inside a \%include inside
|
|
20
21
|
a macro. For that, we recommend you use mp_include.sas to perform the
|
|
21
22
|
include, and then call \%mp_abort(mode=INCLUDE) from the source program (ie,
|
|
22
23
|
OUTSIDE of the top-parent macro).
|
|
24
|
+
The soft abort has also been found to be ineffective in 9.4m6 windows
|
|
25
|
+
environments and above, so in these cases, endsas is used.
|
|
23
26
|
|
|
24
27
|
|
|
25
|
-
@param mac=
|
|
28
|
+
@param mac= (mp_abort.sas) To contain the name of the calling macro. Do not
|
|
29
|
+
use &sysmacroname as this will always resolve to MP_ABORT.
|
|
26
30
|
@param msg= message to be returned
|
|
27
|
-
@param iftrue=
|
|
31
|
+
@param iftrue= (1=1) Supply a condition for which the macro should be executed
|
|
28
32
|
@param errds= (work.mp_abort_errds) There is no clean way to end a process
|
|
29
33
|
within a %include called within a macro. Furthermore, there is no way to
|
|
30
34
|
test if a macro is called within a %include. To handle this particular
|
|
@@ -45,11 +49,12 @@
|
|
|
45
49
|
@li REGULAR (default)
|
|
46
50
|
@li INCLUDE
|
|
47
51
|
|
|
52
|
+
@version 9.4
|
|
53
|
+
@author Allan Bowe
|
|
54
|
+
|
|
48
55
|
<h4> Related Macros </h4>
|
|
49
56
|
@li mp_include.sas
|
|
50
57
|
|
|
51
|
-
@version 9.4
|
|
52
|
-
@author Allan Bowe
|
|
53
58
|
@cond
|
|
54
59
|
**/
|
|
55
60
|
|
|
@@ -166,7 +171,7 @@
|
|
|
166
171
|
/* send response in SASjs JSON format */
|
|
167
172
|
data _null_;
|
|
168
173
|
file _webout mod lrecl=32000 encoding='utf-8';
|
|
169
|
-
length msg syswarningtext syserrortext $32767 ;
|
|
174
|
+
length msg syswarningtext syserrortext $32767 mode $10 ;
|
|
170
175
|
sasdatetime=datetime();
|
|
171
176
|
msg=symget('msg');
|
|
172
177
|
%if &logline>0 %then %do;
|
|
@@ -182,7 +187,10 @@
|
|
|
182
187
|
msg=cats('"',msg,'"');
|
|
183
188
|
if symexist('_debug') then debug=quote(trim(symget('_debug')));
|
|
184
189
|
else debug='""';
|
|
185
|
-
|
|
190
|
+
if symexist('sasjsprocessmode')
|
|
191
|
+
and symget('sasjsprocessmode')='Stored Program'
|
|
192
|
+
then mode='SASJS';
|
|
193
|
+
if mode ne 'SASJS' then put '>>weboutBEGIN<<';
|
|
186
194
|
put '{"SYSDATE" : "' "&SYSDATE" '"';
|
|
187
195
|
put ',"SYSTIME" : "' "&SYSTIME" '"';
|
|
188
196
|
put ',"sasjsAbort" : [{';
|
|
@@ -215,7 +223,7 @@
|
|
|
215
223
|
put ",""SYSWARNINGTEXT"" : " syswarningtext;
|
|
216
224
|
put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
|
|
217
225
|
put "}" @;
|
|
218
|
-
put '>>weboutEND<<';
|
|
226
|
+
if mode ne 'SASJS' then put '>>weboutEND<<';
|
|
219
227
|
run;
|
|
220
228
|
|
|
221
229
|
%put _all_;
|
|
@@ -226,22 +234,30 @@
|
|
|
226
234
|
rc=stpsrvset('program error', 0);
|
|
227
235
|
call symputx("syscc",0,"g");
|
|
228
236
|
run;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
237
|
+
%if &sysscp=WIN
|
|
238
|
+
and "%substr(%str(&sysvlong ),1,8)"="9.04.01M"
|
|
239
|
+
and "%substr(%str(&sysvlong ),9,1)">"5" %then %do;
|
|
240
|
+
/* skip approach (below) does not work in windows m6+ envs */
|
|
241
|
+
endsas;
|
|
242
|
+
%end;
|
|
243
|
+
%else %do;
|
|
244
|
+
/**
|
|
245
|
+
* endsas kills 9.4m3 deployments by orphaning multibridges.
|
|
246
|
+
* Abort variants are ungraceful (non zero return code)
|
|
247
|
+
* This approach lets SAS run silently until the end :-)
|
|
248
|
+
* Caution - fails when called within a %include within a macro
|
|
249
|
+
* Use mp_include() to handle this.
|
|
250
|
+
*/
|
|
251
|
+
filename skip temp;
|
|
252
|
+
data _null_;
|
|
253
|
+
file skip;
|
|
254
|
+
put '%macro skip();';
|
|
255
|
+
comment '%mend skip; -> fix lint ';
|
|
256
|
+
put '%macro skippy();';
|
|
257
|
+
comment '%mend skippy; -> fix lint ';
|
|
258
|
+
run;
|
|
259
|
+
%inc skip;
|
|
260
|
+
%end;
|
|
245
261
|
%end;
|
|
246
262
|
%else %if "&sysprocessmode " = "SAS Compute Server " %then %do;
|
|
247
263
|
/* endsas kills the session making it harder to fetch results */
|
|
@@ -8,17 +8,15 @@
|
|
|
8
8
|
|
|
9
9
|
Usage:
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
options ps=max nonotes nosource;
|
|
12
|
+
%mm_getfoldertree(root=/My/Meta/Path, outds=iwantthisdataset)
|
|
13
|
+
options notes source;
|
|
14
14
|
|
|
15
15
|
@param [in] root= the parent folder under which to return all contents
|
|
16
16
|
@param [out] outds= the dataset to create that contains the list of
|
|
17
17
|
directories
|
|
18
18
|
@param [in] mDebug= set to 1 to show debug messages in the log
|
|
19
19
|
|
|
20
|
-
<h4> SAS Macros </h4>
|
|
21
|
-
|
|
22
20
|
@version 9.4
|
|
23
21
|
@author Allan Bowe
|
|
24
22
|
|
package/package.json
CHANGED