@sasjs/core 4.45.4 → 4.45.6
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 +1 -0
- package/README.md +0 -2
- package/meta/mm_createwebservice.sas +1 -1
- package/package.json +2 -2
- package/server/ms_createwebservice.sas +1 -1
- package/server/ms_getgroups.sas +4 -4
- package/viya/mfv_existsashdat.sas +60 -60
package/.sasjslint
CHANGED
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
|

|
|
5
|
-

|
|
6
|
-
[](/LICENSE)
|
|
7
5
|

|
|
8
6
|
[](https://github.com/sasjs/core/issues?q=is%3Aissue+is%3Aclosed)
|
|
9
7
|
[](https://github.com/sasjs/core/issues)
|
|
@@ -546,7 +546,7 @@ data _null_;
|
|
|
546
546
|
put ' put " ""&wt"" : {"; ';
|
|
547
547
|
put ' put ''"nlobs":'' nlobs; ';
|
|
548
548
|
put ' put '',"nvars":'' nvars; ';
|
|
549
|
-
put ' %mp_jsonout(OBJ,&wt,jref=_sjsref,dslabel=first10rows,showmeta=Y
|
|
549
|
+
put ' %mp_jsonout(OBJ,&wt,jref=_sjsref,dslabel=first10rows,showmeta=Y ';
|
|
550
550
|
put ' ,maxobs=&workobs ';
|
|
551
551
|
put ' ) ';
|
|
552
552
|
put ' data _null_; file _sjsref mod encoding=''utf-8''; ';
|
package/package.json
CHANGED
|
@@ -539,7 +539,7 @@ data _null_;
|
|
|
539
539
|
put ' put " ""&wt"" : {"; ';
|
|
540
540
|
put ' put ''"nlobs":'' nlobs; ';
|
|
541
541
|
put ' put '',"nvars":'' nvars; ';
|
|
542
|
-
put ' %mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,showmeta=Y
|
|
542
|
+
put ' %mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,showmeta=Y ';
|
|
543
543
|
put ' ,maxobs=&workobs ';
|
|
544
544
|
put ' ) ';
|
|
545
545
|
put ' data _null_; file &fref mod encoding=''utf-8'' termstr=lf; ';
|
package/server/ms_getgroups.sas
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
@param [in] uid= (0) Provide the userid on which to filter
|
|
23
23
|
@param [out] outds= (work.ms_getgroups) This output dataset will contain the
|
|
24
24
|
list of groups. Format:
|
|
25
|
-
|NAME:$32.|DESCRIPTION:$
|
|
25
|
+
|NAME:$32.|DESCRIPTION:$256.|GROUPID:best.|
|
|
26
26
|
|---|---|---|
|
|
27
27
|
|`SomeGroup `|`A group `|`1`|
|
|
28
28
|
|`Another Group`|`this is a different group`|`2`|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
%if %sysget(MODE)=desktop %then %do;
|
|
59
59
|
/* groups api does not exist in desktop mode */
|
|
60
60
|
data &outds;
|
|
61
|
-
length NAME $32 DESCRIPTION $
|
|
61
|
+
length NAME $32 DESCRIPTION $256. GROUPID 8;
|
|
62
62
|
name="&sysuserid";
|
|
63
63
|
description="&sysuserid (group - desktop mode)";
|
|
64
64
|
groupid=1;
|
|
@@ -114,7 +114,7 @@ libname &libref JSON fileref=&fref1;
|
|
|
114
114
|
|
|
115
115
|
%if "&user"="0" and "&uid"="0" %then %do;
|
|
116
116
|
data &outds;
|
|
117
|
-
length NAME $32 DESCRIPTION $
|
|
117
|
+
length NAME $32 DESCRIPTION $256. GROUPID 8;
|
|
118
118
|
if _n_=1 then call missing(of _all_);
|
|
119
119
|
set &libref..root;
|
|
120
120
|
drop ordinal_root;
|
|
@@ -122,7 +122,7 @@ libname &libref JSON fileref=&fref1;
|
|
|
122
122
|
%end;
|
|
123
123
|
%else %do;
|
|
124
124
|
data &outds;
|
|
125
|
-
length NAME $32 DESCRIPTION $
|
|
125
|
+
length NAME $32 DESCRIPTION $256. GROUPID 8;
|
|
126
126
|
if _n_=1 then call missing(of _all_);
|
|
127
127
|
set &libref..groups;
|
|
128
128
|
drop ordinal_:;
|
|
@@ -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;
|