@sasjs/core 4.67.1 → 4.67.2
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_retainedkey.sas +6 -5
- package/package.json +1 -1
package/base/mp_retainedkey.sas
CHANGED
|
@@ -148,7 +148,8 @@
|
|
|
148
148
|
%mp_abort(iftrue=(&iserr=1),mac=mp_retainedkey,msg=%superq(msg))
|
|
149
149
|
|
|
150
150
|
proc sql noprint;
|
|
151
|
-
select sum(max(&retained_key),0) into: maxkey
|
|
151
|
+
select sum(max(&retained_key),0) format=32. into: maxkey trimmed
|
|
152
|
+
from &base_libds;
|
|
152
153
|
|
|
153
154
|
/**
|
|
154
155
|
* get base table RK and bus field values for lookup
|
|
@@ -217,19 +218,19 @@ quit;
|
|
|
217
218
|
insert into &maxkeytable
|
|
218
219
|
set keytable="&base_libds"
|
|
219
220
|
,keycolumn="&retained_key"
|
|
220
|
-
,max_key=%
|
|
221
|
+
,max_key=%sysevalf(&maxkey+&newkey_cnt)
|
|
221
222
|
,processed_dttm="%sysfunc(datetime(),%mf_fmtdttm())"dt;
|
|
222
223
|
%end;
|
|
223
224
|
%else %do;
|
|
224
225
|
update &maxkeytable
|
|
225
|
-
set max_key=%
|
|
226
|
+
set max_key=%sysevalf(&maxkey+&newkey_cnt)
|
|
226
227
|
,processed_dttm="%sysfunc(datetime(),%mf_fmtdttm())"dt
|
|
227
228
|
where keytable="&base_libds";
|
|
228
229
|
%end;
|
|
229
230
|
%mp_lockanytable(UNLOCK
|
|
230
231
|
,lib=%scan(&maxkeytable,1,.)
|
|
231
232
|
,ds=%scan(&maxkeytable,2,.)
|
|
232
|
-
,ref=Updating maxkeyvalues with maxkey=%
|
|
233
|
+
,ref=Updating maxkeyvalues with maxkey=%sysevalf(&maxkey+&newkey_cnt)
|
|
233
234
|
,ctl_ds=&locktable
|
|
234
235
|
)
|
|
235
236
|
%end;
|
|
@@ -237,7 +238,7 @@ quit;
|
|
|
237
238
|
/* fill in the missing retained key values */
|
|
238
239
|
%let tempvar=%mf_getuniquename();
|
|
239
240
|
data &outds(drop=&tempvar);
|
|
240
|
-
retain &tempvar %
|
|
241
|
+
retain &tempvar %sysevalf(&maxkey+1);
|
|
241
242
|
set &tempds2;
|
|
242
243
|
if &retained_key =. then &retained_key=&tempvar;
|
|
243
244
|
&tempvar=&tempvar+1;
|
package/package.json
CHANGED