@sasjs/core 4.67.0 → 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/viya/mv_jobflow.sas +34 -19
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
package/viya/mv_jobflow.sas
CHANGED
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
@li mf_nobs.sas
|
|
122
122
|
@li mp_abort.sas
|
|
123
123
|
@li mf_getplatform.sas
|
|
124
|
-
@li
|
|
124
|
+
@li mf_getvarlist.sas
|
|
125
125
|
@li mf_existvarlist.sas
|
|
126
126
|
@li mv_jobwaitfor.sas
|
|
127
127
|
@li mv_jobexecute.sas
|
|
@@ -234,14 +234,12 @@ data _null_;
|
|
|
234
234
|
if last then call symputx('flowcnt',cnt,'l');
|
|
235
235
|
run;
|
|
236
236
|
|
|
237
|
-
/* prepare temporary datasets
|
|
238
|
-
%local fid jid jds
|
|
237
|
+
/* prepare temporary datasets */
|
|
238
|
+
%local fid jid jds jdsapp jdsrunning jdswaitfor;
|
|
239
239
|
data;run;%let jds=&syslast;
|
|
240
|
-
data;run;%let jjson=&syslast;
|
|
241
240
|
data;run;%let jdsapp=&syslast;
|
|
242
241
|
data;run;%let jdsrunning=&syslast;
|
|
243
242
|
data;run;%let jdswaitfor=&syslast;
|
|
244
|
-
%let jfref=%mf_getuniquefileref();
|
|
245
243
|
|
|
246
244
|
/* start loop */
|
|
247
245
|
%do fid=1 %to &flowcnt;
|
|
@@ -259,23 +257,39 @@ data;run;%let jdswaitfor=&syslast;
|
|
|
259
257
|
&dbg. if _n_= 1 then putlog "Loop &fid";
|
|
260
258
|
&dbg. putlog (_all_)(=);
|
|
261
259
|
run;
|
|
260
|
+
/* build list of char and num vars in json format */
|
|
261
|
+
/* Viya 2026 expects all values to be strings */
|
|
262
|
+
%local nvars cvars ii _vnm;
|
|
263
|
+
%let cvars=%mf_getvarlist(&jds,typefilter=C);
|
|
264
|
+
%let nvars=%mf_getvarlist(&jds,typefilter=N);
|
|
262
265
|
%put exporting job variables in json format;
|
|
263
266
|
%do jid=1 %to &jcnt;
|
|
264
|
-
data &jjson;
|
|
265
|
-
set &jds;
|
|
266
|
-
if _n_=&jid then do;
|
|
267
|
-
output;
|
|
268
|
-
stop;
|
|
269
|
-
end;
|
|
270
|
-
run;
|
|
271
|
-
proc json out=&jfref;
|
|
272
|
-
export &jjson / nosastags fmtnumeric;
|
|
273
|
-
run;
|
|
274
267
|
data _null_;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
268
|
+
set &jds;
|
|
269
|
+
if _n_=&jid;
|
|
270
|
+
length _param $32767;
|
|
271
|
+
_param='';
|
|
272
|
+
%if %length(&cvars)>0 %then %do ii=1 %to %sysfunc(countw(&cvars,%str( )));
|
|
273
|
+
%let _vnm=%scan(&cvars,&ii,%str( ));
|
|
274
|
+
if _param ne '' then _param=cats(_param,',');
|
|
275
|
+
_param=cats(_param,'"'
|
|
276
|
+
,"%lowcase(&_vnm)"
|
|
277
|
+
,'":'
|
|
278
|
+
,quote(trim(&_vnm))
|
|
279
|
+
);
|
|
280
|
+
%end;
|
|
281
|
+
%if %length(&nvars)>0 %then %do ii=1 %to %sysfunc(countw(&nvars,%str( )));
|
|
282
|
+
%let _vnm=%scan(&nvars,&ii,%str( ));
|
|
283
|
+
if _param ne '' then _param=cats(_param,',');
|
|
284
|
+
_param=cats(_param,'"'
|
|
285
|
+
,"%lowcase(&_vnm)"
|
|
286
|
+
,'":"'
|
|
287
|
+
,strip(put(&_vnm,best32.))
|
|
288
|
+
,'"'
|
|
289
|
+
);
|
|
290
|
+
%end;
|
|
291
|
+
call symputx(cats('jparams',&jid),_param,'l');
|
|
292
|
+
stop;
|
|
279
293
|
run;
|
|
280
294
|
%local jobuid&jid;
|
|
281
295
|
%let jobuid&jid=0; /* used in next loop */
|
|
@@ -320,6 +334,7 @@ data;run;%let jdswaitfor=&syslast;
|
|
|
320
334
|
,paramstring=%superq(jparams&jid)
|
|
321
335
|
,outds=&jdsapp
|
|
322
336
|
,contextname=&&context&jid
|
|
337
|
+
,mdebug=&mdebug
|
|
323
338
|
)
|
|
324
339
|
data &jdsapp;
|
|
325
340
|
format jobparams $32767.;
|