@sasjs/core 3.11.0 → 4.1.0
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 +6 -4
- package/base/mf_abort.sas +1 -1
- package/base/mf_dedup.sas +0 -1
- package/base/mf_existvar.sas +4 -4
- package/base/mf_getfilesize.sas +31 -14
- package/base/mf_wordsinstr1andstr2.sas +0 -1
- package/base/mf_wordsinstr1butnotstr2.sas +5 -5
- package/base/mp_abort.sas +3 -2
- package/base/mp_assertdsobs.sas +8 -9
- package/base/mp_assertscope.sas +39 -14
- package/base/mp_coretable.sas +27 -1
- package/base/mp_csv2ds.sas +0 -4
- package/base/mp_ds2squeeze.sas +120 -0
- package/base/mp_getmaxvarlengths.sas +51 -18
- package/base/mp_guesspk.sas +245 -225
- package/base/mp_init.sas +37 -32
- package/base/mp_jsonout.sas +0 -1
- package/base/mp_stackdiffs.sas +596 -0
- package/base/mp_storediffs.sas +11 -29
- package/fcmp/mcf_init.sas +44 -0
- package/fcmp/mcf_length.sas +83 -0
- package/fcmp/mcf_stpsrv_header.sas +7 -3
- package/fcmp/mcf_string2file.sas +10 -1
- package/meta/mm_createwebservice.sas +1 -2
- package/meta/mm_getgroupmembers.sas +15 -8
- package/meta/mm_updatestpsourcecode.sas +0 -11
- package/meta/mm_webout.sas +1 -1
- package/package.json +2 -5
- package/server/ms_webout.sas +1 -1
- package/viya/mv_createwebservice.sas +1 -2
- package/viya/mv_deletefoldermember.sas +1 -0
- package/viya/mv_deletejes.sas +1 -0
- package/viya/mv_webout.sas +1 -1
- package/viya/mv_getaccesstoken.sas +0 -32
- package/viya/mv_getapptoken.sas +0 -23
- package/viya/mv_getrefreshtoken.sas +0 -33
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@file
|
|
3
|
+
@brief Returns the length of a numeric value
|
|
4
|
+
@details
|
|
5
|
+
Returns the length, in bytes, of a numeric value. If the value is
|
|
6
|
+
missing, then 0 is returned.
|
|
7
|
+
|
|
8
|
+
The function itself takes the following (positional) parameters:
|
|
9
|
+
|
|
10
|
+
| PARAMETER | DESCRIPTION |
|
|
11
|
+
|---|---|
|
|
12
|
+
| var | variable (or value) to be tested|
|
|
13
|
+
|
|
14
|
+
Usage:
|
|
15
|
+
|
|
16
|
+
%mcf_length(wrap=YES, insert_cmplib=YES)
|
|
17
|
+
|
|
18
|
+
data _null_;
|
|
19
|
+
ina=1;
|
|
20
|
+
inb=10000000;
|
|
21
|
+
inc=12345678;
|
|
22
|
+
ind=.;
|
|
23
|
+
outa=mcf_length(ina);
|
|
24
|
+
outb=mcf_length(inb);
|
|
25
|
+
outc=mcf_length(inc);
|
|
26
|
+
outd=mcf_length(ind);
|
|
27
|
+
put (out:)(=);
|
|
28
|
+
run;
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
|
|
32
|
+
> outa=3 outb=4 outc=5 outd=0
|
|
33
|
+
|
|
34
|
+
@param [out] wrap= (NO) Choose YES to add the proc fcmp wrapper.
|
|
35
|
+
@param [out] insert_cmplib= (NO) Choose YES to insert the package into the
|
|
36
|
+
CMPLIB reference.
|
|
37
|
+
@param [out] lib= (work) The output library in which to create the catalog.
|
|
38
|
+
@param [out] cat= (sasjs) The output catalog in which to create the package.
|
|
39
|
+
@param [out] pkg= (utils) The output package in which to create the function.
|
|
40
|
+
Uses a 3 part format: libref.catalog.package
|
|
41
|
+
|
|
42
|
+
<h4> SAS Macros </h4>
|
|
43
|
+
@li mcf_init.sas
|
|
44
|
+
|
|
45
|
+
<h4> Related Programs </h4>
|
|
46
|
+
@li mcf_length.test.sas
|
|
47
|
+
@li mp_init.sas
|
|
48
|
+
|
|
49
|
+
**/
|
|
50
|
+
|
|
51
|
+
%macro mcf_length(wrap=NO
|
|
52
|
+
,insert_cmplib=NO
|
|
53
|
+
,lib=WORK
|
|
54
|
+
,cat=SASJS
|
|
55
|
+
,pkg=UTILS
|
|
56
|
+
)/*/STORE SOURCE*/;
|
|
57
|
+
|
|
58
|
+
%if %mcf_init(mcf_length)=1 %then %return;
|
|
59
|
+
|
|
60
|
+
%if &wrap=YES %then %do;
|
|
61
|
+
proc fcmp outlib=&lib..&cat..&pkg;
|
|
62
|
+
%end;
|
|
63
|
+
|
|
64
|
+
function mcf_length(var);
|
|
65
|
+
if var=. then len=0;
|
|
66
|
+
else if missing(var) or trunc(var,3)=var then len=3;
|
|
67
|
+
else if trunc(var,4)=var then len=4;
|
|
68
|
+
else if trunc(var,5)=var then len=5;
|
|
69
|
+
else if trunc(var,6)=var then len=6;
|
|
70
|
+
else if trunc(var,7)=var then len=7;
|
|
71
|
+
else len=8;
|
|
72
|
+
return(len);
|
|
73
|
+
endsub;
|
|
74
|
+
|
|
75
|
+
%if &wrap=YES %then %do;
|
|
76
|
+
quit;
|
|
77
|
+
%end;
|
|
78
|
+
|
|
79
|
+
%if &insert_cmplib=YES %then %do;
|
|
80
|
+
options insert=(CMPLIB=(&lib..&cat));
|
|
81
|
+
%end;
|
|
82
|
+
|
|
83
|
+
%mend mcf_length;
|
|
@@ -55,7 +55,11 @@
|
|
|
55
55
|
Uses a 3 part format: libref.catalog.package
|
|
56
56
|
|
|
57
57
|
<h4> SAS Macros </h4>
|
|
58
|
-
@li
|
|
58
|
+
@li mcf_init.sas
|
|
59
|
+
|
|
60
|
+
<h4> Related Programs </h4>
|
|
61
|
+
@li mcf_stpsrv_header.test.sas
|
|
62
|
+
@li mp_init.sas
|
|
59
63
|
|
|
60
64
|
**/
|
|
61
65
|
|
|
@@ -66,10 +70,10 @@
|
|
|
66
70
|
,pkg=UTILS
|
|
67
71
|
)/*/STORE SOURCE*/;
|
|
68
72
|
|
|
69
|
-
%if %
|
|
73
|
+
%if %mcf_init(stpsrv_header)=1 %then %return;
|
|
70
74
|
|
|
71
75
|
%if &wrap=YES %then %do;
|
|
72
|
-
proc fcmp
|
|
76
|
+
proc fcmp outlib=&lib..&cat..&pkg;
|
|
73
77
|
%end;
|
|
74
78
|
|
|
75
79
|
function stpsrv_header(name $, value $);
|
package/fcmp/mcf_string2file.sas
CHANGED
|
@@ -39,6 +39,13 @@
|
|
|
39
39
|
@param [out] pkg= (utils) The output package in which to create the function.
|
|
40
40
|
Uses a 3 part format: libref.catalog.package
|
|
41
41
|
|
|
42
|
+
<h4> SAS Macros </h4>
|
|
43
|
+
@li mcf_init.sas
|
|
44
|
+
|
|
45
|
+
<h4> Related Programs </h4>
|
|
46
|
+
@li mcf_stpsrv_header.test.sas
|
|
47
|
+
@li mp_init.sas
|
|
48
|
+
|
|
42
49
|
**/
|
|
43
50
|
|
|
44
51
|
%macro mcf_string2file(wrap=NO
|
|
@@ -48,8 +55,10 @@
|
|
|
48
55
|
,pkg=UTILS
|
|
49
56
|
)/*/STORE SOURCE*/;
|
|
50
57
|
|
|
58
|
+
%if %mcf_init(mcf_string2file)=1 %then %return;
|
|
59
|
+
|
|
51
60
|
%if &wrap=YES %then %do;
|
|
52
|
-
proc fcmp
|
|
61
|
+
proc fcmp outlib=&lib..&cat..&pkg;
|
|
53
62
|
%end;
|
|
54
63
|
|
|
55
64
|
function mcf_string2file(filepath $, string $, mode $);
|
|
@@ -95,7 +95,6 @@ data _null_;
|
|
|
95
95
|
put ' ';
|
|
96
96
|
put '%macro mp_jsonout(action,ds,jref=_webout,dslabel=,fmt=Y ';
|
|
97
97
|
put ' ,engine=DATASTEP ';
|
|
98
|
-
put ' ,dbg=0 /* DEPRECATED */ ';
|
|
99
98
|
put ' ,missing=NULL ';
|
|
100
99
|
put ' ,showmeta=NO ';
|
|
101
100
|
put ')/*/STORE SOURCE*/; ';
|
|
@@ -426,7 +425,7 @@ data _null_;
|
|
|
426
425
|
put ' sysvlong=quote(trim(symget(''sysvlong''))); ';
|
|
427
426
|
put ' put '',"SYSVLONG" : '' sysvlong; ';
|
|
428
427
|
put ' put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" "; ';
|
|
429
|
-
put ' put '',"END_DTTM" : "'' "%sysfunc(datetime(),
|
|
428
|
+
put ' put '',"END_DTTM" : "'' "%sysfunc(datetime(),E8601DT26.6)" ''" ''; ';
|
|
430
429
|
put ' length memsize $32; ';
|
|
431
430
|
put ' memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)"; ';
|
|
432
431
|
put ' memsize=quote(cats(memsize)); ';
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
@file
|
|
3
3
|
@brief Creates dataset with all members of a metadata group
|
|
4
|
-
@details
|
|
4
|
+
@details This macro will query SAS metadata and return all the members
|
|
5
|
+
of a particular group.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
Usage:
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
%mm_getgroupmembers(someGroupName
|
|
10
|
+
,outds=work.mm_getgroupmembers
|
|
11
|
+
,emails=YES
|
|
12
|
+
)
|
|
11
13
|
|
|
12
14
|
@param group metadata group for which to bring back members
|
|
13
|
-
@param outds=
|
|
14
|
-
|
|
15
|
-
@param
|
|
15
|
+
@param outds= (work.mm_getgroupmembers) The dataset to create that contains
|
|
16
|
+
the list of members
|
|
17
|
+
@param emails= (NO) Set to YES to bring back email addresses
|
|
18
|
+
@param id= (NO) Set to yes if passing an ID rather than a group name
|
|
16
19
|
|
|
17
20
|
@returns outds dataset containing all members of the metadata group
|
|
18
21
|
|
|
22
|
+
<h4> Related Macros </h4>
|
|
23
|
+
@li mm_getgorups.sas
|
|
24
|
+
@li mm_adduser2group.sas
|
|
25
|
+
|
|
19
26
|
@version 9.2
|
|
20
27
|
@author Allan Bowe
|
|
21
28
|
|
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
@param [in] stpcode= the source file (or fileref) containing the SAS code to load
|
|
14
14
|
into the stp. For multiple files, they should simply be concatenated first.
|
|
15
15
|
@param [in] minify= set to YES in order to strip comments, blank lines, and CRLFs.
|
|
16
|
-
|
|
17
|
-
@param frefin= deprecated - a unique fileref is now always used
|
|
18
|
-
@param frefout= deprecated - a unique fileref is now always used
|
|
19
16
|
@param mDebug= set to 1 to show debug messages in the log
|
|
20
17
|
|
|
21
18
|
@version 9.3
|
|
@@ -30,16 +27,8 @@
|
|
|
30
27
|
,stpcode=
|
|
31
28
|
,minify=NO
|
|
32
29
|
,mdebug=0
|
|
33
|
-
/* deprecated */
|
|
34
|
-
,frefin=inmeta
|
|
35
|
-
,frefout=outmeta
|
|
36
30
|
);
|
|
37
31
|
|
|
38
|
-
%if &frefin ne inmeta or &frefout ne outmeta %then %do;
|
|
39
|
-
%put %str(WARN)ING: the frefin and frefout parameters will be deprecated in
|
|
40
|
-
an upcoming release.;
|
|
41
|
-
%end;
|
|
42
|
-
|
|
43
32
|
/* first, check if STP exists */
|
|
44
33
|
%local tsuri;
|
|
45
34
|
%let tsuri=stopifempty ;
|
package/meta/mm_webout.sas
CHANGED
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
sysvlong=quote(trim(symget('sysvlong')));
|
|
166
166
|
put ',"SYSVLONG" : ' sysvlong;
|
|
167
167
|
put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" ";
|
|
168
|
-
put ',"END_DTTM" : "' "%sysfunc(datetime(),
|
|
168
|
+
put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
|
|
169
169
|
length memsize $32;
|
|
170
170
|
memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)";
|
|
171
171
|
memsize=quote(cats(memsize));
|
package/package.json
CHANGED
|
@@ -33,10 +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": "
|
|
36
|
+
"@sasjs/cli": "3.6.0"
|
|
37
37
|
},
|
|
38
|
-
"
|
|
39
|
-
"ts-loader": "^9.2.6"
|
|
40
|
-
},
|
|
41
|
-
"version": "3.11.0"
|
|
38
|
+
"version": "4.1.0"
|
|
42
39
|
}
|
package/server/ms_webout.sas
CHANGED
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
sysvlong=quote(trim(symget('sysvlong')));
|
|
162
162
|
put ',"SYSVLONG" : ' sysvlong;
|
|
163
163
|
put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" ";
|
|
164
|
-
put ',"END_DTTM" : "' "%sysfunc(datetime(),
|
|
164
|
+
put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
|
|
165
165
|
length autoexec $512;
|
|
166
166
|
autoexec=quote(urlencode(trim(getoption('autoexec'))));
|
|
167
167
|
put ',"AUTOEXEC" : ' autoexec;
|
|
@@ -239,7 +239,6 @@ data _null_;
|
|
|
239
239
|
put ' ';
|
|
240
240
|
put '%macro mp_jsonout(action,ds,jref=_webout,dslabel=,fmt=Y ';
|
|
241
241
|
put ' ,engine=DATASTEP ';
|
|
242
|
-
put ' ,dbg=0 /* DEPRECATED */ ';
|
|
243
242
|
put ' ,missing=NULL ';
|
|
244
243
|
put ' ,showmeta=NO ';
|
|
245
244
|
put ')/*/STORE SOURCE*/; ';
|
|
@@ -627,7 +626,7 @@ data _null_;
|
|
|
627
626
|
put ' sysvlong=quote(trim(symget(''sysvlong''))); ';
|
|
628
627
|
put ' put '',"SYSVLONG" : '' sysvlong; ';
|
|
629
628
|
put ' put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" "; ';
|
|
630
|
-
put ' put '',"END_DTTM" : "'' "%sysfunc(datetime(),
|
|
629
|
+
put ' put '',"END_DTTM" : "'' "%sysfunc(datetime(),E8601DT26.6)" ''" ''; ';
|
|
631
630
|
put ' length memsize $32; ';
|
|
632
631
|
put ' memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)"; ';
|
|
633
632
|
put ' memsize=quote(cats(memsize)); ';
|
|
@@ -117,6 +117,7 @@ libname &libref1a JSON fileref=&fname1a;
|
|
|
117
117
|
%let found=0;
|
|
118
118
|
%put Getting object uri from &libref1a..items;
|
|
119
119
|
data _null_;
|
|
120
|
+
length contenttype name $1000;
|
|
120
121
|
set &libref1a..items;
|
|
121
122
|
if contenttype="&contenttype" and upcase(name)="%upcase(&name)" then do;
|
|
122
123
|
call symputx('uri',uri,'l');
|
package/viya/mv_deletejes.sas
CHANGED
|
@@ -114,6 +114,7 @@ libname &libref1a JSON fileref=&fname1a;
|
|
|
114
114
|
%let found=0;
|
|
115
115
|
%put Getting object uri from &libref1a..items;
|
|
116
116
|
data _null_;
|
|
117
|
+
length contenttype name $1000;
|
|
117
118
|
set &libref1a..items;
|
|
118
119
|
if contenttype='jobDefinition' and upcase(name)="%upcase(&name)" then do;
|
|
119
120
|
call symputx('uri',cats("&base_uri",uri),'l');
|
package/viya/mv_webout.sas
CHANGED
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
sysvlong=quote(trim(symget('sysvlong')));
|
|
226
226
|
put ',"SYSVLONG" : ' sysvlong;
|
|
227
227
|
put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" ";
|
|
228
|
-
put ',"END_DTTM" : "' "%sysfunc(datetime(),
|
|
228
|
+
put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
|
|
229
229
|
length memsize $32;
|
|
230
230
|
memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)";
|
|
231
231
|
memsize=quote(cats(memsize));
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@file mv_getaccesstoken.sas
|
|
3
|
-
@brief deprecated - replaced by mv_tokenrefresh.sas
|
|
4
|
-
|
|
5
|
-
@version VIYA V.03.04
|
|
6
|
-
@author Allan Bowe, source: https://github.com/sasjs/core
|
|
7
|
-
|
|
8
|
-
<h4> SAS Macros </h4>
|
|
9
|
-
@li mv_tokenrefresh.sas
|
|
10
|
-
|
|
11
|
-
**/
|
|
12
|
-
|
|
13
|
-
%macro mv_getaccesstoken(client_id=someclient
|
|
14
|
-
,client_secret=somesecret
|
|
15
|
-
,grant_type=authorization_code
|
|
16
|
-
,code=
|
|
17
|
-
,user=
|
|
18
|
-
,pass=
|
|
19
|
-
,access_token_var=ACCESS_TOKEN
|
|
20
|
-
,refresh_token_var=REFRESH_TOKEN
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
%mv_tokenrefresh(client_id=&client_id
|
|
24
|
-
,client_secret=&client_secret
|
|
25
|
-
,grant_type=&grant_type
|
|
26
|
-
,user=&user
|
|
27
|
-
,pass=&pass
|
|
28
|
-
,access_token_var=&access_token_var
|
|
29
|
-
,refresh_token_var=&refresh_token_var
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
%mend mv_getaccesstoken;
|
package/viya/mv_getapptoken.sas
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@file
|
|
3
|
-
@brief deprecated - replaced by mv_registerclient.sas
|
|
4
|
-
|
|
5
|
-
@version VIYA V.03.04
|
|
6
|
-
@author Allan Bowe, source: https://github.com/sasjs/core
|
|
7
|
-
|
|
8
|
-
<h4> SAS Macros </h4>
|
|
9
|
-
@li mv_registerclient.sas
|
|
10
|
-
|
|
11
|
-
**/
|
|
12
|
-
|
|
13
|
-
%macro mv_getapptoken(client_id=someclient
|
|
14
|
-
,client_secret=somesecret
|
|
15
|
-
,grant_type=authorization_code
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
%mv_registerclient(client_id=&client_id
|
|
19
|
-
,client_secret=&client_secret
|
|
20
|
-
,grant_type=&grant_type
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
%mend mv_getapptoken;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@file mv_getrefreshtoken.sas
|
|
3
|
-
@brief deprecated - replaced by mv_tokenauth.sas
|
|
4
|
-
|
|
5
|
-
@version VIYA V.03.04
|
|
6
|
-
@author Allan Bowe, source: https://github.com/sasjs/core
|
|
7
|
-
|
|
8
|
-
<h4> SAS Macros </h4>
|
|
9
|
-
@li mv_tokenauth.sas
|
|
10
|
-
|
|
11
|
-
**/
|
|
12
|
-
|
|
13
|
-
%macro mv_getrefreshtoken(client_id=someclient
|
|
14
|
-
,client_secret=somesecret
|
|
15
|
-
,grant_type=authorization_code
|
|
16
|
-
,code=
|
|
17
|
-
,user=
|
|
18
|
-
,pass=
|
|
19
|
-
,access_token_var=ACCESS_TOKEN
|
|
20
|
-
,refresh_token_var=REFRESH_TOKEN
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
%mv_tokenauth(client_id=&client_id
|
|
24
|
-
,client_secret=&client_secret
|
|
25
|
-
,grant_type=&grant_type
|
|
26
|
-
,code=&code
|
|
27
|
-
,user=&user
|
|
28
|
-
,pass=&pass
|
|
29
|
-
,access_token_var=&access_token_var
|
|
30
|
-
,refresh_token_var=&refresh_token_var
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
%mend mv_getrefreshtoken;
|