@sasjs/core 4.46.3 → 4.46.5
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/.env.server +3 -0
- package/base/mf_getfmtlist.sas +3 -4
- package/base/mp_chop.sas +1 -1
- package/base/mp_cntlout.sas +2 -2
- package/base/mp_getformats.sas +13 -3
- package/base/mp_loadformat.sas +44 -9
- package/base/mp_md5.sas +1 -2
- package/base/mp_storediffs.sas +3 -4
- package/openvpn-repo-pkg-key.pub +53 -0
- package/package.json +2 -2
package/.env.server
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
CLIENT=clientID1
|
|
2
|
+
ACCESS_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRJZCI6ImNsaWVudElEMSIsInVzZXJJZCI6MTQsImlhdCI6MTY4OTI2MDUyOCwiZXhwIjoxNjg5MzQ2OTI4fQ.u3WsTrwchcrS741qfKRkH28oDyyZJF4KXsHwF6MTR3g
|
|
3
|
+
REFRESH_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRJZCI6ImNsaWVudElEMSIsInVzZXJJZCI6MTQsImlhdCI6MTY4OTI2MDUyOCwiZXhwIjoxNjkxODUyNTI4fQ.byb5rEq3FyMlHOwk5y7oZ6qA5FoL9v37dvKYwsLBfP0
|
package/base/mf_getfmtlist.sas
CHANGED
package/base/mp_chop.sas
CHANGED
package/base/mp_cntlout.sas
CHANGED
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
%end;
|
|
59
59
|
|
|
60
60
|
proc format lib=&libcat cntlout=&cntlds;
|
|
61
|
-
%if "&fmtlist" ne "0" %then %do;
|
|
61
|
+
%if "&fmtlist" ne "0" and "&fmtlist" ne "" %then %do;
|
|
62
62
|
select
|
|
63
|
-
%do i=1 %to %sysfunc(countw(&fmtlist));
|
|
63
|
+
%do i=1 %to %sysfunc(countw(&fmtlist,%str( )));
|
|
64
64
|
%scan(&fmtlist,&i,%str( ))
|
|
65
65
|
%end;
|
|
66
66
|
;
|
package/base/mp_getformats.sas
CHANGED
|
@@ -7,10 +7,15 @@
|
|
|
7
7
|
Formats are taken from the library / dataset reference and / or a static
|
|
8
8
|
format list.
|
|
9
9
|
|
|
10
|
+
Note - the source for this information is the dictionary.formats table. This
|
|
11
|
+
cannot show formats that are not already declared in the FMTSEARCH path.
|
|
12
|
+
|
|
10
13
|
Example usage:
|
|
11
14
|
|
|
12
15
|
%mp_getformats(lib=sashelp,ds=prdsale,outsummary=work.dictable)
|
|
13
16
|
|
|
17
|
+
%mp_getformats(fmtlist=FORMAT1 $FORMAT2 @INFMT3,outsummary=work.table2)
|
|
18
|
+
|
|
14
19
|
@param [in] lib= (0) The libref for which to return formats.
|
|
15
20
|
@todo Enable exporting of formats for an entire library
|
|
16
21
|
@param [in] ds= (0) The dataset from which to obtain format definitions
|
|
@@ -49,7 +54,9 @@ https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#
|
|
|
49
54
|
|
|
50
55
|
|
|
51
56
|
<h4> Related Macros </h4>
|
|
57
|
+
@li mf_getfmtlist.sas
|
|
52
58
|
@li mp_applyformats.sas
|
|
59
|
+
@li mp_cntlout.sas
|
|
53
60
|
@li mp_getformats.test.sas
|
|
54
61
|
|
|
55
62
|
@version 9.2
|
|
@@ -66,7 +73,7 @@ https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#
|
|
|
66
73
|
|
|
67
74
|
%local i fmt allfmts tempds fmtcnt;
|
|
68
75
|
|
|
69
|
-
%if "&fmtlist" ne "0" %then %do i=1 %to %sysfunc(countw(&fmtlist
|
|
76
|
+
%if "&fmtlist" ne "0" %then %do i=1 %to %sysfunc(countw(&fmtlist,%str( )));
|
|
70
77
|
/* ensure format list contains format _name_ only */
|
|
71
78
|
%let fmt=%scan(&fmtlist,&i,%str( ));
|
|
72
79
|
%let fmt=%mf_getfmtname(&fmt);
|
|
@@ -90,8 +97,7 @@ https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#
|
|
|
90
97
|
proc sql;
|
|
91
98
|
create table &outsummary as
|
|
92
99
|
select * from dictionary.formats
|
|
93
|
-
where fmtname in (%mf_getquotedstr(&allfmts,quote=D))
|
|
94
|
-
and fmttype='F';
|
|
100
|
+
where fmtname in (%mf_getquotedstr(&allfmts,quote=D));
|
|
95
101
|
|
|
96
102
|
%if "&outdetail" ne "0" %then %do;
|
|
97
103
|
/* ensure base table always exists */
|
|
@@ -115,6 +121,10 @@ create table &outsummary as
|
|
|
115
121
|
data &tempds;
|
|
116
122
|
if 0 then set &outdetail;
|
|
117
123
|
set &tempds;
|
|
124
|
+
/* set fmtrow (position of record within the format) */
|
|
125
|
+
by type fmtname notsorted;
|
|
126
|
+
if first.fmtname then fmtrow=1;
|
|
127
|
+
else fmtrow+1;
|
|
118
128
|
run;
|
|
119
129
|
proc append base=&outdetail data=&tempds ;
|
|
120
130
|
run;
|
package/base/mp_loadformat.sas
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
);
|
|
69
69
|
/* set up local macro variables and temporary tables (with a prefix) */
|
|
70
70
|
%local err msg prefix dslist i var fmtlist ibufsize;
|
|
71
|
-
%let dslist=base_fmts template inlibds ds1 stagedata storediffs;
|
|
71
|
+
%let dslist=base_fmts template inlibds ds1 stagedata storediffs del1 del2;
|
|
72
72
|
%if &outds_add=0 %then %let dslist=&dslist outds_add;
|
|
73
73
|
%if &outds_del=0 %then %let dslist=&dslist outds_del;
|
|
74
74
|
%if &outds_mod=0 %then %let dslist=&dslist outds_mod;
|
|
@@ -200,28 +200,47 @@ create table &outds_add(drop=&delete_col) as
|
|
|
200
200
|
order by type, fmtname, fmtrow;
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
|
-
* Identify
|
|
203
|
+
* Identify modified records
|
|
204
204
|
*/
|
|
205
|
-
create table &
|
|
205
|
+
create table &outds_mod (drop=&delete_col) as
|
|
206
206
|
select a.*
|
|
207
207
|
from &inlibds a
|
|
208
208
|
inner join &base_fmts b
|
|
209
209
|
on a.type=b.type and a.fmtname=b.fmtname and a.fmtrow=b.fmtrow
|
|
210
|
-
where upcase(a.&delete_col)
|
|
210
|
+
where upcase(a.&delete_col) ne "YES"
|
|
211
|
+
and a.fmthash ne b.fmthash
|
|
211
212
|
order by type, fmtname, fmtrow;
|
|
212
213
|
|
|
213
214
|
/**
|
|
214
|
-
* Identify
|
|
215
|
+
* Identify deleted records
|
|
215
216
|
*/
|
|
216
|
-
create table &
|
|
217
|
+
create table &outds_del(drop=&delete_col) as
|
|
217
218
|
select a.*
|
|
218
219
|
from &inlibds a
|
|
219
220
|
inner join &base_fmts b
|
|
220
221
|
on a.type=b.type and a.fmtname=b.fmtname and a.fmtrow=b.fmtrow
|
|
221
|
-
where upcase(a.&delete_col)
|
|
222
|
-
and a.fmthash ne b.fmthash
|
|
222
|
+
where upcase(a.&delete_col)="YES"
|
|
223
223
|
order by type, fmtname, fmtrow;
|
|
224
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Identify fully deleted formats (where every record is removed)
|
|
227
|
+
* These require to be explicitly deleted in proc format
|
|
228
|
+
* del1 - identify _partial_ deletes
|
|
229
|
+
* del2 - exclude these, and also formats that come with _additions_
|
|
230
|
+
*/
|
|
231
|
+
create table &del1 as
|
|
232
|
+
select a.*
|
|
233
|
+
from &base_fmts a
|
|
234
|
+
left join &outds_del b
|
|
235
|
+
on a.type=b.type and a.fmtname=b.fmtname and a.fmtrow=b.fmtrow
|
|
236
|
+
where b.fmtrow is null;
|
|
237
|
+
|
|
238
|
+
create table &del2 as
|
|
239
|
+
select * from &outds_del
|
|
240
|
+
where cats(type,fmtname) not in (select cats(type,fmtname) from &outds_add)
|
|
241
|
+
and cats(type,fmtname) not in (select cats(type,fmtname) from &del1);
|
|
242
|
+
|
|
243
|
+
|
|
225
244
|
%mp_abort(
|
|
226
245
|
iftrue=(&syscc ne 0)
|
|
227
246
|
,mac=&sysmacroname
|
|
@@ -253,7 +272,7 @@ create table &outds_mod (drop=&delete_col) as
|
|
|
253
272
|
,msg=%str(SYSCC=&syscc prior to actual load)
|
|
254
273
|
)
|
|
255
274
|
%if &loadtarget=YES %then %do;
|
|
256
|
-
%if %mf_nobs(&stagedata)=0 %then %do;
|
|
275
|
+
%if %mf_nobs(&stagedata)=0 and %mf_nobs(&del2)=0 %then %do;
|
|
257
276
|
%put There are no changes to load in &libcat!;
|
|
258
277
|
%return;
|
|
259
278
|
%end;
|
|
@@ -269,6 +288,22 @@ create table &outds_mod (drop=&delete_col) as
|
|
|
269
288
|
/* do the actual load */
|
|
270
289
|
proc format lib=&libcat cntlin=&stagedata;
|
|
271
290
|
run;
|
|
291
|
+
/* apply any full deletes */
|
|
292
|
+
%if %mf_nobs(&del2)>0 %then %do;
|
|
293
|
+
%local delfmtlist;
|
|
294
|
+
proc sql noprint;
|
|
295
|
+
select distinct case when type='N' then cats(fmtname,'.FORMAT')
|
|
296
|
+
when type='C' then cats(fmtname,'.FORMATC')
|
|
297
|
+
when type='J' then cats(fmtname,'.INFMTC')
|
|
298
|
+
when type='I' then cats(fmtname,'.INFMT')
|
|
299
|
+
else cats(fmtname,'.BADENTRY!!!') end
|
|
300
|
+
into: delfmtlist
|
|
301
|
+
separated by ' '
|
|
302
|
+
from &del2;
|
|
303
|
+
proc catalog catalog=&libcat;
|
|
304
|
+
delete &delfmtlist;
|
|
305
|
+
quit;
|
|
306
|
+
%end;
|
|
272
307
|
%if &locklibds ne 0 %then %do;
|
|
273
308
|
/* unlock the table */
|
|
274
309
|
%mp_lockanytable(UNLOCK
|
package/base/mp_md5.sas
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
@file
|
|
3
3
|
@brief Generates an md5 expression for hashing a set of variables
|
|
4
4
|
@details This is the same algorithm used to hash records in
|
|
5
|
-
[Data Controller for SAS](https://datacontroller.io)
|
|
6
|
-
to 5 users).
|
|
5
|
+
[Data Controller for SAS](https://datacontroller.io).
|
|
7
6
|
|
|
8
7
|
It is not designed to be efficient - it is designed to be effective,
|
|
9
8
|
given the range of edge cases (large floating points, special missing
|
package/base/mp_storediffs.sas
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
data recovery, and change re-application. This macro is one of many
|
|
7
7
|
data management utilities used in [Data Controller for SAS](
|
|
8
8
|
https:datacontroller.io) - a comprehensive data ingestion solution, which
|
|
9
|
-
works on any SAS platform (Viya, SAS 9, Foundation)
|
|
10
|
-
users.
|
|
9
|
+
works on any SAS platform (Viya, SAS 9, Foundation).
|
|
11
10
|
|
|
12
11
|
NOTE - this macro does not validate the inputs. It is assumed that the
|
|
13
12
|
datasets containing the new / changed / deleted rows are CORRECT, contain
|
|
@@ -165,7 +164,7 @@ data &ds4;
|
|
|
165
164
|
if upcase(&inds_auto)="&ds2" then tgtvar_type='N';
|
|
166
165
|
else if upcase(&inds_auto)="&ds3" then tgtvar_type='C';
|
|
167
166
|
else do;
|
|
168
|
-
putlog
|
|
167
|
+
putlog 'ERR' +(-1) "OR: unidentified vartype input!" &inds_auto;
|
|
169
168
|
call symputx('syscc',98);
|
|
170
169
|
end;
|
|
171
170
|
|
|
@@ -174,7 +173,7 @@ data &ds4;
|
|
|
174
173
|
else if &inds_keep="&modds" then move_type='M';
|
|
175
174
|
else if &inds_keep="&origds" then move_type='O';
|
|
176
175
|
else do;
|
|
177
|
-
putlog
|
|
176
|
+
putlog 'ERR' +(-1) "OR: unidentified movetype input!" &inds_keep;
|
|
178
177
|
call symputx('syscc',99);
|
|
179
178
|
end;
|
|
180
179
|
tgtvar_nm=upcase(tgtvar_nm);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
2
|
+
Version: GnuPG v1
|
|
3
|
+
|
|
4
|
+
mQINBFxkI3gBEADMiqkRvmd/xtPBqH9GoFYIfd4BgVZi3N47Idt2RVSxxO3pYqhj
|
|
5
|
+
JU7pRxihw+1g3qPql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