@sasjs/core 4.45.5 → 4.45.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/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
  [![npm package][npm-image]][npm-url]
3
3
  [![Github Workflow][githubworkflow-image]][githubworkflow-url]
4
4
  ![npm](https://img.shields.io/npm/dt/@sasjs/core)
5
- ![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/@sasjs/core)
6
- [![License](https://img.shields.io/apm/l/atomic-design-ui.svg)](/LICENSE)
7
5
  ![GitHub top language](https://img.shields.io/github/languages/top/sasjs/core)
8
6
  [![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/sasjs/core)](https://github.com/sasjs/core/issues?q=is%3Aissue+is%3Aclosed)
9
7
  [![GitHub issues](https://img.shields.io/github/issues-raw/sasjs/core)](https://github.com/sasjs/core/issues)
package/base/mf_abort.sas CHANGED
@@ -12,7 +12,7 @@
12
12
  **/
13
13
 
14
14
  %macro mf_abort(mac=mf_abort.sas, msg=, iftrue=%str(1=1)
15
- )/*/STORE SOURCE*/;
15
+ )/des='ungraceful abort' /*STORE SOURCE*/;
16
16
 
17
17
  %if not(%eval(%unquote(&iftrue))) %then %return;
18
18
 
@@ -24,4 +24,4 @@
24
24
 
25
25
  %mend mf_abort;
26
26
 
27
- /** @endcond */
27
+ /** @endcond */
package/package.json CHANGED
@@ -33,7 +33,7 @@
33
33
  "prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks || true"
34
34
  },
35
35
  "devDependencies": {
36
- "@sasjs/cli": "3.13.0"
36
+ "@sasjs/cli": "3.24.0"
37
37
  },
38
- "version": "4.45.5"
38
+ "version": "4.45.7"
39
39
  }
@@ -1,60 +1,60 @@
1
- /**
2
- @file mfv_existsashdat.sas
3
- @brief Checks whether a CAS sashdat dataset exists in persistent storage.
4
- @details Can be used in open code, eg as follows:
5
-
6
- %if %mfv_existsashdat(libds=casuser.sometable) %then %put yes it does!;
7
-
8
- The function uses `dosubl()` to run the `table.fileinfo` action, for the
9
- specified library, filtering for `*.sashdat` tables. The results are stored
10
- in a WORK table (&outprefix._&lib). If that table already exists, it is
11
- queried instead, to avoid the dosubl() performance hit.
12
-
13
- To force a rescan, just use a new `&outprefix` value, or delete the table(s)
14
- before running the function.
15
-
16
- @param libds library.dataset
17
- @param outprefix= (work.mfv_existsashdat) Used to store the current HDATA
18
- tables to improve subsequent query performance. This reference is a prefix
19
- and is converted to `&prefix._{libref}`
20
-
21
- @return output returns 1 or 0
22
-
23
- @version 0.2
24
- @author Mathieu Blauw
25
- **/
26
-
27
- %macro mfv_existsashdat(libds,outprefix=work.mfv_existsashdat
28
- );
29
- %local rc dsid name lib ds;
30
- %let lib=%upcase(%scan(&libds,1,'.'));
31
- %let ds=%upcase(%scan(&libds,-1,'.'));
32
-
33
- /* if table does not exist, create it */
34
- %if %sysfunc(exist(&outprefix._&lib)) ne 1 %then %do;
35
- %let rc=%sysfunc(dosubl(%nrstr(
36
- /* Read in table list (once per &lib per session) */
37
- proc cas;
38
- table.fileinfo result=source_list /caslib="&lib";
39
- val=findtable(source_list);
40
- saveresult val dataout=&outprefix._&lib;
41
- quit;
42
- /* Only keep name, without file extension */
43
- data &outprefix._&lib;
44
- set &outprefix._&lib(where=(Name like '%.sashdat') keep=Name);
45
- Name=upcase(scan(Name,1,'.'));
46
- run;
47
- )));
48
- %end;
49
-
50
- /* Scan table for hdat existence */
51
- %let dsid=%sysfunc(open(&outprefix._&lib(where=(name="&ds"))));
52
- %syscall set(dsid);
53
- %let rc = %sysfunc(fetch(&dsid));
54
- %let rc = %sysfunc(close(&dsid));
55
-
56
- /* Return result */
57
- %if "%trim(&name)"="%trim(&ds)" %then 1;
58
- %else 0;
59
-
60
- %mend mfv_existsashdat;
1
+ /**
2
+ @file mfv_existsashdat.sas
3
+ @brief Checks whether a CAS sashdat dataset exists in persistent storage.
4
+ @details Can be used in open code, eg as follows:
5
+
6
+ %if %mfv_existsashdat(libds=casuser.sometable) %then %put yes it does!;
7
+
8
+ The function uses `dosubl()` to run the `table.fileinfo` action, for the
9
+ specified library, filtering for `*.sashdat` tables. The results are stored
10
+ in a WORK table (&outprefix._&lib). If that table already exists, it is
11
+ queried instead, to avoid the dosubl() performance hit.
12
+
13
+ To force a rescan, just use a new `&outprefix` value, or delete the table(s)
14
+ before running the function.
15
+
16
+ @param libds library.dataset
17
+ @param outprefix= (work.mfv_existsashdat) Used to store the current HDATA
18
+ tables to improve subsequent query performance. This reference is a prefix
19
+ and is converted to `&prefix._{libref}`
20
+
21
+ @return output returns 1 or 0
22
+
23
+ @version 0.2
24
+ @author Mathieu Blauw
25
+ **/
26
+
27
+ %macro mfv_existsashdat(libds,outprefix=work.mfv_existsashdat
28
+ );
29
+ %local rc dsid name lib ds;
30
+ %let lib=%upcase(%scan(&libds,1,'.'));
31
+ %let ds=%upcase(%scan(&libds,-1,'.'));
32
+
33
+ /* if table does not exist, create it */
34
+ %if %sysfunc(exist(&outprefix._&lib)) ne 1 %then %do;
35
+ %let rc=%sysfunc(dosubl(%nrstr(
36
+ /* Read in table list (once per &lib per session) */
37
+ proc cas;
38
+ table.fileinfo result=source_list /caslib="&lib";
39
+ val=findtable(source_list);
40
+ saveresult val dataout=&outprefix._&lib;
41
+ quit;
42
+ /* Only keep name, without file extension */
43
+ data &outprefix._&lib;
44
+ set &outprefix._&lib(where=(Name like '%.sashdat') keep=Name);
45
+ Name=upcase(scan(Name,1,'.'));
46
+ run;
47
+ )));
48
+ %end;
49
+
50
+ /* Scan table for hdat existence */
51
+ %let dsid=%sysfunc(open(&outprefix._&lib(where=(name="&ds"))));
52
+ %syscall set(dsid);
53
+ %let rc = %sysfunc(fetch(&dsid));
54
+ %let rc = %sysfunc(close(&dsid));
55
+
56
+ /* Return result */
57
+ %if "%trim(&name)"="%trim(&ds)" %then 1;
58
+ %else 0;
59
+
60
+ %mend mfv_existsashdat;