@sasjs/core 4.51.1 → 4.51.3
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/base/mp_stripdiffs.sas +8 -8
- package/package.json +1 -1
package/base/mp_stripdiffs.sas
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
@li deleted rows - these are re-inserted
|
|
10
10
|
@li changed rows - differences are reverted
|
|
11
|
-
@li added rows -
|
|
11
|
+
@li added rows - marked with `_____DELETE__THIS__RECORD_____="YES"`
|
|
12
12
|
|
|
13
13
|
These changes are NOT applied to the base table - a staging dataset is
|
|
14
14
|
simply prepared for an ETL process to action. In Data Controller, this
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
in mddl_dc_difftable.sas
|
|
25
25
|
@param [out] outds= (work.mp_stripdiffs) Output table containing the diffs.
|
|
26
26
|
Has the same format as the base datset, plus a
|
|
27
|
-
`
|
|
27
|
+
`_____DELETE__THIS__RECORD_____` variable.
|
|
28
28
|
@param [in] mdebug= set to 1 to enable DEBUG messages and preserve outputs
|
|
29
29
|
|
|
30
30
|
<h4> SAS Macros </h4>
|
|
@@ -120,7 +120,7 @@ run;
|
|
|
120
120
|
%let ds3=%upcase(work.%mf_getuniquename(prefix=mpsd_keychar));
|
|
121
121
|
proc transpose data=&ds2(where=(tgtvar_type='C'))
|
|
122
122
|
out=&ds3(drop=_name_);
|
|
123
|
-
by KEY_HASH;
|
|
123
|
+
by KEY_HASH PROCESSED_DTTM;
|
|
124
124
|
id TGTVAR_NM;
|
|
125
125
|
var charval;
|
|
126
126
|
run;
|
|
@@ -128,7 +128,7 @@ run;
|
|
|
128
128
|
%let ds4=%upcase(work.%mf_getuniquename(prefix=mpsd_keynum));
|
|
129
129
|
proc transpose data=&ds2(where=(tgtvar_type='N'))
|
|
130
130
|
out=&ds4(drop=_name_);
|
|
131
|
-
by KEY_HASH;
|
|
131
|
+
by KEY_HASH PROCESSED_DTTM;
|
|
132
132
|
id TGTVAR_NM;
|
|
133
133
|
var numval;
|
|
134
134
|
run;
|
|
@@ -138,7 +138,7 @@ run;
|
|
|
138
138
|
|
|
139
139
|
%let ds5=%upcase(work.%mf_getuniquename(prefix=mpsd_merged));
|
|
140
140
|
data &ds5;
|
|
141
|
-
length key_hash $32;
|
|
141
|
+
length key_hash $32 processed_dttm 8;
|
|
142
142
|
merge &ds3 &ds4;
|
|
143
143
|
by key_hash;
|
|
144
144
|
if not missing(key_hash);
|
|
@@ -146,7 +146,7 @@ run;
|
|
|
146
146
|
|
|
147
147
|
/* join to base table for preliminary stage DS */
|
|
148
148
|
proc sql;
|
|
149
|
-
create table &outds as select "No " as
|
|
149
|
+
create table &outds as select "No " as _____DELETE__THIS__RECORD_____,
|
|
150
150
|
b.*
|
|
151
151
|
from &ds5 a
|
|
152
152
|
inner join &libds b
|
|
@@ -183,7 +183,7 @@ data _null_;
|
|
|
183
183
|
end;
|
|
184
184
|
else if move_type='A' then do;
|
|
185
185
|
if first.key_hash then do;
|
|
186
|
-
put "update &outds set
|
|
186
|
+
put "update &outds set _____DELETE__THIS__RECORD_____='Yes' where 1=1 "@@;
|
|
187
187
|
end;
|
|
188
188
|
/* gating if - as only need PK now */
|
|
189
189
|
if is_pk=1;
|
|
@@ -194,7 +194,7 @@ data _null_;
|
|
|
194
194
|
end;
|
|
195
195
|
else if move_type='D' then do;
|
|
196
196
|
if first.key_hash then do;
|
|
197
|
-
put "insert into &outds set
|
|
197
|
+
put "insert into &outds set _____DELETE__THIS__RECORD_____='No' " @@;
|
|
198
198
|
end;
|
|
199
199
|
put " ," tgtvar_nm '=' @@;
|
|
200
200
|
charval=quote(cats(oldval_char));
|
package/package.json
CHANGED