@sasjs/core 4.27.7 → 4.27.10

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 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. We take a unique "soft abort" approach - we open a macro
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= to contain the name of the calling macro
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= supply a condition under which the macro should be executed.
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,30 @@
226
231
  rc=stpsrvset('program error', 0);
227
232
  call symputx("syscc",0,"g");
228
233
  run;
229
- /**
230
- * endsas kills 9.4m3 deployments by orphaning multibridges.
231
- * Abort variants are ungraceful (non zero return code)
232
- * This approach lets SAS run silently until the end :-)
233
- * Caution - fails when called within a %include within a macro
234
- * Use mp_include() to handle this.
235
- */
236
- filename skip temp;
237
- data _null_;
238
- file skip;
239
- put '%macro skip();';
240
- comment '%mend skip; -> fix lint ';
241
- put '%macro skippy();';
242
- comment '%mend skippy; -> fix lint ';
243
- run;
244
- %inc skip;
234
+ %if &sysscp=WIN
235
+ and "%substr(%str(&sysvlong ),1,8)"="9.04.01M"
236
+ and "%substr(%str(&sysvlong ),9,1)">"5" %then %do;
237
+ /* skip approach (below) does not work in windows m6+ envs */
238
+ endsas;
239
+ %end;
240
+ %else %do;
241
+ /**
242
+ * endsas kills 9.4m3 deployments by orphaning multibridges.
243
+ * Abort variants are ungraceful (non zero return code)
244
+ * This approach lets SAS run silently until the end :-)
245
+ * Caution - fails when called within a %include within a macro
246
+ * Use mp_include() to handle this.
247
+ */
248
+ filename skip temp;
249
+ data _null_;
250
+ file skip;
251
+ put '%macro skip();';
252
+ comment '%mend skip; -> fix lint ';
253
+ put '%macro skippy();';
254
+ comment '%mend skippy; -> fix lint ';
255
+ run;
256
+ %inc skip;
257
+ %end;
245
258
  %end;
246
259
  %else %if "&sysprocessmode " = "SAS Compute Server " %then %do;
247
260
  /* endsas kills the session making it harder to fetch results */
@@ -8,17 +8,15 @@
8
8
 
9
9
  Usage:
10
10
 
11
- options ps=max nonotes nosource;
12
- %mm_getfoldertree(root=/My/Meta/Path, outds=iwantthisdataset)
13
- options notes source;
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
 
@@ -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
- %if &tsuri=stopifempty %then %do;
74
- %put %str(WARN)ING: &tree&name.(StoredProcess) not found!;
75
- %return;
76
- %end;
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
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.13.0"
37
37
  },
38
- "version": "4.27.7"
38
+ "version": "4.27.10"
39
39
  }