@sasjs/core 3.11.1 → 4.2.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 +7 -5
- 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_createwebservice.sas +10 -8
- package/base/mp_csv2ds.sas +0 -4
- package/base/mp_deletefolder.sas +1 -0
- package/base/mp_dirlist.sas +9 -2
- package/base/mp_ds2csv.sas +119 -14
- 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 +39 -32
- package/base/mp_jsonout.sas +6 -2
- package/base/mp_stackdiffs.sas +592 -0
- package/base/mp_storediffs.sas +11 -29
- package/base/mp_testservice.sas +25 -11
- package/fcmp/mcf_init.sas +44 -0
- package/fcmp/mcf_length.sas +83 -0
- package/fcmp/mcf_stpsrv_header.sas +6 -2
- package/fcmp/mcf_string2file.sas +9 -0
- package/meta/mm_createstp.sas +1 -0
- package/meta/mm_createwebservice.sas +7 -3
- package/meta/mm_getgroupmembers.sas +15 -8
- package/meta/mm_getservercontexts.sas +11 -4
- package/meta/mm_updatestpsourcecode.sas +0 -11
- package/meta/mm_webout.sas +1 -1
- package/package.json +1 -1
- package/server/ms_webout.sas +1 -1
- package/viya/mv_createwebservice.sas +7 -3
- 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
package/base/mp_testservice.sas
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
@file
|
|
3
|
-
@brief Will execute a
|
|
2
|
+
@file
|
|
3
|
+
@brief Will execute a SASjs web service on SAS 9 or Viya
|
|
4
4
|
@details Prepares the input files and retrieves the resulting datasets from
|
|
5
5
|
the response JSON.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
duration=60*5
|
|
9
|
-
)
|
|
7
|
+
|
|
10
8
|
|
|
11
9
|
Note - the _webout fileref should NOT be assigned prior to running this macro.
|
|
12
10
|
|
|
@@ -14,6 +12,10 @@
|
|
|
14
12
|
@param [in] inputfiles=(0) A list of space seperated fileref:filename pairs as
|
|
15
13
|
follows:
|
|
16
14
|
inputfiles=inref:filename inref2:filename2
|
|
15
|
+
@param [in] inputdatasets= (0) All datasets in this space seperated list are
|
|
16
|
+
converted into SASJS-formatted CSVs (see mp_ds2csv.sas) files and added to
|
|
17
|
+
the list of `inputfiles` for ingestion. The dataset will be sent with the
|
|
18
|
+
same name (no need for a colon modifier).
|
|
17
19
|
@param [in] inputparams=(0) A dataset containing name/value pairs in the
|
|
18
20
|
following format:
|
|
19
21
|
|name:$32|value:$1000|
|
|
@@ -38,9 +40,13 @@
|
|
|
38
40
|
@li mf_getuniquename.sas
|
|
39
41
|
@li mp_abort.sas
|
|
40
42
|
@li mp_binarycopy.sas
|
|
43
|
+
@li mp_ds2csv.sas
|
|
41
44
|
@li mv_getjobresult.sas
|
|
42
45
|
@li mv_jobflow.sas
|
|
43
46
|
|
|
47
|
+
<h4> Related Programs </h4>
|
|
48
|
+
@li mp_testservice.test.sas
|
|
49
|
+
|
|
44
50
|
@version 9.4
|
|
45
51
|
@author Allan Bowe
|
|
46
52
|
|
|
@@ -48,6 +54,7 @@
|
|
|
48
54
|
|
|
49
55
|
%macro mp_testservice(program,
|
|
50
56
|
inputfiles=0,
|
|
57
|
+
inputdatasets=0,
|
|
51
58
|
inputparams=0,
|
|
52
59
|
debug=log,
|
|
53
60
|
mdebug=0,
|
|
@@ -56,7 +63,7 @@
|
|
|
56
63
|
viyaresult=WEBOUT_JSON,
|
|
57
64
|
viyacontext=SAS Job Execution compute context
|
|
58
65
|
)/*/STORE SOURCE*/;
|
|
59
|
-
%local dbg;
|
|
66
|
+
%local dbg pcnt fref1 webref i webcount var platform;
|
|
60
67
|
%if &mdebug=1 %then %do;
|
|
61
68
|
%put &sysmacroname entry vars:;
|
|
62
69
|
%put _local_;
|
|
@@ -64,7 +71,6 @@
|
|
|
64
71
|
%else %let dbg=*;
|
|
65
72
|
|
|
66
73
|
/* sanitise inputparams */
|
|
67
|
-
%local pcnt;
|
|
68
74
|
%let pcnt=0;
|
|
69
75
|
%if &inputparams ne 0 %then %do;
|
|
70
76
|
data _null_;
|
|
@@ -86,17 +92,25 @@
|
|
|
86
92
|
)
|
|
87
93
|
%end;
|
|
88
94
|
|
|
95
|
+
/* convert inputdatasets to filerefs */
|
|
96
|
+
%if "&inputdatasets" ne "0" %then %do;
|
|
97
|
+
%if %quote(&inputfiles)=0 %then %let inputfiles=;
|
|
98
|
+
%do i=1 %to %sysfunc(countw(&inputdatasets,%str( )));
|
|
99
|
+
%let var=%scan(&inputdatasets,&i,%str( ));
|
|
100
|
+
%local dsref&i;
|
|
101
|
+
%let dsref&i=%mf_getuniquefileref();
|
|
102
|
+
%mp_ds2csv(&var,outref=&&dsref&i,headerformat=SASJS)
|
|
103
|
+
%let inputfiles=&inputfiles &&dsref&i:%scan(&var,-1,.);
|
|
104
|
+
%end;
|
|
105
|
+
%end;
|
|
106
|
+
|
|
89
107
|
|
|
90
|
-
%local fref1 webref;
|
|
91
108
|
%let fref1=%mf_getuniquefileref();
|
|
92
109
|
%let webref=%mf_getuniquefileref();
|
|
93
|
-
|
|
94
|
-
%local platform;
|
|
95
110
|
%let platform=%mf_getplatform();
|
|
96
111
|
%if &platform=SASMETA %then %do;
|
|
97
112
|
|
|
98
113
|
/* parse the input files */
|
|
99
|
-
%local webcount i var;
|
|
100
114
|
%if %quote(&inputfiles) ne 0 %then %do;
|
|
101
115
|
%let webcount=%sysfunc(countw(&inputfiles));
|
|
102
116
|
%put &=webcount;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@file
|
|
3
|
+
@brief Sets up the mcf_xx functions
|
|
4
|
+
@details
|
|
5
|
+
There is no (efficient) way to determine if an mcf_xx macro has already been
|
|
6
|
+
invoked. So, we make use of a global macro variable list to keep track.
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
|
|
10
|
+
%mcf_init(MCF_LENGTH)
|
|
11
|
+
|
|
12
|
+
Returns:
|
|
13
|
+
|
|
14
|
+
> 1 (if already initialised) else 0
|
|
15
|
+
|
|
16
|
+
@param [in] func The function to be initialised
|
|
17
|
+
|
|
18
|
+
<h4> Related Macros </h4>
|
|
19
|
+
@li mcf_init.test.sas
|
|
20
|
+
|
|
21
|
+
**/
|
|
22
|
+
|
|
23
|
+
%macro mcf_init(func
|
|
24
|
+
)/*/STORE SOURCE*/;
|
|
25
|
+
|
|
26
|
+
%if not (%symexist(SASJS_PREFIX)) %then %do;
|
|
27
|
+
%global SASJS_PREFIX;
|
|
28
|
+
%let SASJS_PREFIX=SASJS;
|
|
29
|
+
%end;
|
|
30
|
+
|
|
31
|
+
%let func=%upcase(&func);
|
|
32
|
+
|
|
33
|
+
/* the / character is just a seperator */
|
|
34
|
+
%global &sasjs_prefix._FUNCTIONS;
|
|
35
|
+
%if %index(&&&sasjs_prefix._FUNCTIONS,&func/)>0 %then %do;
|
|
36
|
+
1
|
|
37
|
+
%return;
|
|
38
|
+
%end;
|
|
39
|
+
%else %do;
|
|
40
|
+
%let &sasjs_prefix._FUNCTIONS=&&&sasjs_prefix._FUNCTIONS &func/;
|
|
41
|
+
0
|
|
42
|
+
%end;
|
|
43
|
+
|
|
44
|
+
%mend mcf_init;
|
|
@@ -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,7 +70,7 @@
|
|
|
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
76
|
proc fcmp outlib=&lib..&cat..&pkg;
|
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,6 +55,8 @@
|
|
|
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
61
|
proc fcmp outlib=&lib..&cat..&pkg;
|
|
53
62
|
%end;
|
package/meta/mm_createstp.sas
CHANGED
|
@@ -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*/; ';
|
|
@@ -191,7 +190,12 @@ data _null_;
|
|
|
191
190
|
put ' )); ';
|
|
192
191
|
put ' %do i=1 %to &numcols; ';
|
|
193
192
|
put ' length &&name&i $&&len&i; ';
|
|
194
|
-
put ' &&
|
|
193
|
+
put ' %if &&typelong&i=num %then %do; ';
|
|
194
|
+
put ' &&name&i=left(put(&&newname&i,&&fmt&i)); ';
|
|
195
|
+
put ' %end; ';
|
|
196
|
+
put ' %else %do; ';
|
|
197
|
+
put ' &&name&i=put(&&newname&i,&&fmt&i); ';
|
|
198
|
+
put ' %end; ';
|
|
195
199
|
put ' drop &&newname&i; ';
|
|
196
200
|
put ' %end; ';
|
|
197
201
|
put ' if _error_ then call symputx(''syscc'',1012); ';
|
|
@@ -426,7 +430,7 @@ data _null_;
|
|
|
426
430
|
put ' sysvlong=quote(trim(symget(''sysvlong''))); ';
|
|
427
431
|
put ' put '',"SYSVLONG" : '' sysvlong; ';
|
|
428
432
|
put ' put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" "; ';
|
|
429
|
-
put ' put '',"END_DTTM" : "'' "%sysfunc(datetime(),
|
|
433
|
+
put ' put '',"END_DTTM" : "'' "%sysfunc(datetime(),E8601DT26.6)" ''" ''; ';
|
|
430
434
|
put ' length memsize $32; ';
|
|
431
435
|
put ' memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)"; ';
|
|
432
436
|
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
|
|
|
@@ -41,7 +41,11 @@ run;
|
|
|
41
41
|
|
|
42
42
|
filename __mc1 temp;
|
|
43
43
|
filename __mc2 temp;
|
|
44
|
-
data &outds;
|
|
44
|
+
data &outds;
|
|
45
|
+
length serveruri servername $200;
|
|
46
|
+
call missing (of _all_);
|
|
47
|
+
stop;
|
|
48
|
+
run;
|
|
45
49
|
%do x=1 %to &repocnt;
|
|
46
50
|
options metarepository=&&repo&x;
|
|
47
51
|
proc metadata in=
|
|
@@ -60,13 +64,16 @@ data &outds; length serveruri servername $200; stop;run;
|
|
|
60
64
|
data _null_;
|
|
61
65
|
file __mc2;
|
|
62
66
|
put '<SXLEMAP version="1.2" name="SASContexts"><TABLE name="SASContexts">';
|
|
63
|
-
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/ServerContext
|
|
67
|
+
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/ServerContext";
|
|
68
|
+
put "</TABLE-PATH>";
|
|
64
69
|
put '<COLUMN name="serveruri">';
|
|
65
|
-
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/ServerContext/@Id
|
|
70
|
+
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/ServerContext/@Id";
|
|
71
|
+
put "</PATH>";
|
|
66
72
|
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>200</LENGTH>";
|
|
67
73
|
put '</COLUMN>';
|
|
68
74
|
put '<COLUMN name="servername">';
|
|
69
|
-
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/ServerContext/@Name
|
|
75
|
+
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/ServerContext/@Name";
|
|
76
|
+
put "</PATH>";
|
|
70
77
|
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>200</LENGTH>";
|
|
71
78
|
put '</COLUMN>';
|
|
72
79
|
put '</TABLE></SXLEMAP>';
|
|
@@ -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
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*/; ';
|
|
@@ -335,7 +334,12 @@ data _null_;
|
|
|
335
334
|
put ' )); ';
|
|
336
335
|
put ' %do i=1 %to &numcols; ';
|
|
337
336
|
put ' length &&name&i $&&len&i; ';
|
|
338
|
-
put ' &&
|
|
337
|
+
put ' %if &&typelong&i=num %then %do; ';
|
|
338
|
+
put ' &&name&i=left(put(&&newname&i,&&fmt&i)); ';
|
|
339
|
+
put ' %end; ';
|
|
340
|
+
put ' %else %do; ';
|
|
341
|
+
put ' &&name&i=put(&&newname&i,&&fmt&i); ';
|
|
342
|
+
put ' %end; ';
|
|
339
343
|
put ' drop &&newname&i; ';
|
|
340
344
|
put ' %end; ';
|
|
341
345
|
put ' if _error_ then call symputx(''syscc'',1012); ';
|
|
@@ -627,7 +631,7 @@ data _null_;
|
|
|
627
631
|
put ' sysvlong=quote(trim(symget(''sysvlong''))); ';
|
|
628
632
|
put ' put '',"SYSVLONG" : '' sysvlong; ';
|
|
629
633
|
put ' put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" "; ';
|
|
630
|
-
put ' put '',"END_DTTM" : "'' "%sysfunc(datetime(),
|
|
634
|
+
put ' put '',"END_DTTM" : "'' "%sysfunc(datetime(),E8601DT26.6)" ''" ''; ';
|
|
631
635
|
put ' length memsize $32; ';
|
|
632
636
|
put ' memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)"; ';
|
|
633
637
|
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;
|