@sasjs/core 4.27.6 → 4.27.9
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 +32 -21
- package/meta/mm_getfoldertree.sas +3 -5
- package/meta/mm_getstpcode.sas +5 -5
- package/package.json +1 -1
- package/xplatform/mx_getcode.sas +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.
|
|
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
|
|
|
@@ -226,22 +231,28 @@
|
|
|
226
231
|
rc=stpsrvset('program error', 0);
|
|
227
232
|
call symputx("syscc",0,"g");
|
|
228
233
|
run;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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 */
|
|
236
|
+
endsas;
|
|
237
|
+
%end;
|
|
238
|
+
%else %do;
|
|
239
|
+
/**
|
|
240
|
+
* endsas kills 9.4m3 deployments by orphaning multibridges.
|
|
241
|
+
* Abort variants are ungraceful (non zero return code)
|
|
242
|
+
* This approach lets SAS run silently until the end :-)
|
|
243
|
+
* Caution - fails when called within a %include within a macro
|
|
244
|
+
* Use mp_include() to handle this.
|
|
245
|
+
*/
|
|
246
|
+
filename skip temp;
|
|
247
|
+
data _null_;
|
|
248
|
+
file skip;
|
|
249
|
+
put '%macro skip();';
|
|
250
|
+
comment '%mend skip; -> fix lint ';
|
|
251
|
+
put '%macro skippy();';
|
|
252
|
+
comment '%mend skippy; -> fix lint ';
|
|
253
|
+
run;
|
|
254
|
+
%inc skip;
|
|
255
|
+
%end;
|
|
245
256
|
%end;
|
|
246
257
|
%else %if "&sysprocessmode " = "SAS Compute Server " %then %do;
|
|
247
258
|
/* 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/meta/mm_getstpcode.sas
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<h4> SAS Macros </h4>
|
|
23
23
|
@li mf_getuniquefileref.sas
|
|
24
|
+
@li mp_abort.sas
|
|
24
25
|
|
|
25
26
|
@author Allan Bowe
|
|
26
27
|
|
|
@@ -70,11 +71,10 @@ data _null_;
|
|
|
70
71
|
else put (_all_)(=);
|
|
71
72
|
run;
|
|
72
73
|
|
|
73
|
-
%
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
%mp_abort(iftrue= (&tsuri=stopifempty)
|
|
75
|
+
,mac=mm_getstpcode
|
|
76
|
+
,msg=%str(&tree&name.(StoredProcess) not found!)
|
|
77
|
+
)
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Now we can extract the textstore
|
package/package.json
CHANGED
package/xplatform/mx_getcode.sas
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
%ms_getfile(&loc..sas, outref=&outref)
|
|
36
36
|
%end;
|
|
37
37
|
%else %if &platform=SAS9 or &platform=SASMETA %then %do;
|
|
38
|
-
%mm_getstpcode(tree=&loc,
|
|
38
|
+
%mm_getstpcode(tree=&loc,outref=&outref)
|
|
39
39
|
%end;
|
|
40
40
|
%else %if &platform=SASVIYA %then %do;
|
|
41
41
|
/* extract name & path from &loc */
|