@sasjs/core 7.1.5 → 7.1.7

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/.sasjslint CHANGED
@@ -30,6 +30,7 @@
30
30
  "noNestedMacros": "error",
31
31
  "noSingleAsteriskComments": "error",
32
32
  "noSpacesInFileNames": "error",
33
+ "noXcmd": "error",
33
34
  "noTabs": "error",
34
35
  "noTrailingSpaces": "error",
35
36
  "noUndeclaredMacros": "error",
package/README.md CHANGED
@@ -1,12 +1,6 @@
1
1
  # Macro Core
2
2
 
3
- [![npm package](https://img.shields.io/npm/v/@sasjs/core.svg)](http://npmjs.org/package/@sasjs/core)
4
- [![Github Workflow](https://github.com/sasjs/core/actions/workflows/main.yml/badge.svg)](https://github.com/sasjs/core/blob/main/.github/workflows/main.yml)
5
- [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sasjs/core/badge)](https://scorecard.dev/viewer/?uri=github.com/sasjs/core)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/sasjs/core/blob/main/LICENSE)
7
- [![npms.io](https://img.shields.io/npms-io/final-score/@sasjs/core)](https://npms.io/search?q=%40sasjs%2Fcore)
8
- ![npm](https://img.shields.io/npm/dt/@sasjs/core)
9
- ![GitHub last commit](https://img.shields.io/github/last-commit/sasjs/core)
3
+ [![npm package](https://img.shields.io/npm/v/@sasjs/core.svg)](http://npmjs.org/package/@sasjs/core) [![Github Workflow](https://github.com/sasjs/core/actions/workflows/main.yml/badge.svg)](https://github.com/sasjs/core/blob/main/.github/workflows/main.yml) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sasjs/core/badge)](https://scorecard.dev/viewer/?uri=github.com/sasjs/core) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/sasjs/core/blob/main/LICENSE) [![Socket Badge](https://socket.dev/api/badge/npm/package/@sasjs/core)](https://socket.dev/npm/package/@sasjs/core) ![npm](https://img.shields.io/npm/dt/@sasjs/core) ![GitHub last commit](https://img.shields.io/github/last-commit/sasjs/core)
10
4
 
11
5
 
12
6
  Much quality. Many standards. The **Macro Core** library exists to save time and development effort! Herein ye shall find a veritable host of MIT-licenced, production quality SAS macros. These are a mix of tools, utilities, functions and code generators that are useful in the context of [Application Development](https://sasapps.io) on the SAS platform (eg https://datacontroller.io). [Contributions](https://github.com/sasjs/core/blob/main/.github/CONTRIBUTING.md) are welcome.
@@ -26,25 +26,33 @@
26
26
  %macro mf_trimstr(basestr,trimstr);
27
27
  %local baselen trimlen trimval;
28
28
 
29
- /* return if basestr is shorter than trimstr (or 0) */
30
29
  %let baselen=%length(%superq(basestr));
31
30
  %let trimlen=%length(%superq(trimstr));
32
- %if &baselen < &trimlen or &baselen=0 %then %return;
33
31
 
34
- /* obtain the characters from the end of basestr */
35
- %let trimval=%qsubstr(%superq(basestr)
36
- ,%length(%superq(basestr))-&trimlen+1
37
- ,&trimlen);
32
+ /* nothing to remove from nothing */
33
+ %if &baselen=0 %then %return;
38
34
 
39
- /* compare and if matching, chop it off! */
40
- %if %superq(basestr)=%superq(trimstr) %then %do;
41
- %return;
42
- %end;
43
- %else %if %superq(trimval)=%superq(trimstr) %then %do;
44
- %qsubstr(%superq(basestr),1,%length(%superq(basestr))-&trimlen)
35
+ %if &baselen < &trimlen %then %do;
36
+ /* a value shorter than the trim string cannot end with it, so it is
37
+ returned unchanged - returning nothing here lost the value */
38
+ &basestr
45
39
  %end;
46
40
  %else %do;
47
- &basestr
41
+ /* obtain the characters from the end of basestr */
42
+ %let trimval=%qsubstr(%superq(basestr)
43
+ ,&baselen-&trimlen+1
44
+ ,&trimlen);
45
+
46
+ /* compare and if matching, chop it off! */
47
+ %if %superq(basestr)=%superq(trimstr) %then %do;
48
+ %return;
49
+ %end;
50
+ %else %if %superq(trimval)=%superq(trimstr) %then %do;
51
+ %qsubstr(%superq(basestr),1,&baselen-&trimlen)
52
+ %end;
53
+ %else %do;
54
+ &basestr
55
+ %end;
48
56
  %end;
49
57
 
50
58
  %mend mf_trimstr;
@@ -18,6 +18,7 @@
18
18
  @version 9.4
19
19
  @author Allan Bowe
20
20
 
21
+ @sasjslint {"noXcmd": false}
21
22
  **/
22
23
 
23
24
  %macro mmx_createmetafolder(loc=,user=,pass=);
@@ -19,7 +19,7 @@
19
19
  @version 9.4
20
20
  @author Allan Bowe
21
21
 
22
- @sasjslint {"maxLineLength": 123}
22
+ @sasjslint {"maxLineLength": 123, "noXcmd": false}
23
23
  **/
24
24
 
25
25
  %macro mmx_deletemetafolder(loc=,user=,pass=);
package/package.json CHANGED
@@ -22,6 +22,17 @@
22
22
  "release": {
23
23
  "branches": [
24
24
  "main"
25
+ ],
26
+ "plugins": [
27
+ "@semantic-release/commit-analyzer",
28
+ "@semantic-release/release-notes-generator",
29
+ [
30
+ "@semantic-release/npm",
31
+ {
32
+ "npmPublish": false
33
+ }
34
+ ],
35
+ "@semantic-release/github"
25
36
  ]
26
37
  },
27
38
  "publishConfig": {
@@ -43,5 +54,5 @@
43
54
  "devDependencies": {
44
55
  "@nogoo9/gitleaks": "8.30.1-post.2"
45
56
  },
46
- "version": "7.1.5"
57
+ "version": "7.1.7"
47
58
  }
@@ -210,7 +210,7 @@ filename &webref "&webrefpath";
210
210
  /* proc stp gives no job status - say so rather than imply success */
211
211
  %if "&outstatus" ne "0" %then %do;
212
212
  data &outstatus;
213
- length state $20 uri $256 errmsg $256 platform $10;
213
+ length state $256 uri $256 errmsg $256 platform $10;
214
214
  state='unknown';
215
215
  uri='';
216
216
  errmsg='proc stp returns no job status';
@@ -311,7 +311,13 @@ filename &webref "&webrefpath";
311
311
  /* the outcome, before the flow table goes away */
312
312
  %if "&outstatus" ne "0" %then %do;
313
313
  data &outstatus;
314
- length state $20 uri $256 errmsg $32767 platform $10;
314
+ /* state is copied from the flow table, so this length is a ceiling, not a
315
+ * target. mp_init's strict set includes varlenchk=ERROR, so a shorter
316
+ * one fails the step outright: OBS=0 then switches the rest of
317
+ * the session to syntax check, and every later proc reports a problem
318
+ * that has nothing to do with it. 256 matches uri and covers a state
319
+ * read out of JSON. */
320
+ length state $256 uri $256 errmsg $32767 platform $10;
315
321
  platform='SASVIYA';
316
322
  errmsg='';
317
323
  set &jobds(keep=state uri);
@@ -363,7 +369,7 @@ filename &webref "&webrefpath";
363
369
  modify &outstatus;
364
370
  errmsg=symget('abortmsg');
365
371
  replace;
366
- end;
372
+ run;
367
373
  %end;
368
374
  %end;
369
375
  /* only a ref created here may be cleared */
@@ -393,7 +399,7 @@ filename &webref "&webrefpath";
393
399
  )
394
400
  %if "&outstatus" ne "0" %then %do;
395
401
  data &outstatus;
396
- length state $20 uri $256 errmsg $32767 platform $10;
402
+ length state $256 uri $256 errmsg $32767 platform $10;
397
403
  length line $32767;
398
404
  retain state 'completed' uri '' errmsg '' platform 'SASJS' abortseen 0;
399
405
  infile &respref end=eof lrecl=32767;