1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-03 15:40:05 +00:00

fix: enabling makedata support for charvars > and tables without primary keys. Also added tests.

This commit is contained in:
munja
2021-12-23 10:56:01 +00:00
parent 8eb4f0844c
commit f2991cfd63
3 changed files with 71 additions and 4 deletions

View File

@@ -7702,11 +7702,15 @@ lock &libds clear;
<h4> SAS Macros </h4>
@li mf_getuniquename.sas
@li mf_getvarlen.sas
@li mf_getvarlist.sas
@li mf_islibds.sas
@li mf_nobs.sas
@li mp_getcols.sas
@li mp_getpk.sas
<h4> Related Macros </h4>
@li mp_makedata.test.sas
@version 9.2
@author Allan Bowe
@@ -7738,7 +7742,7 @@ lock &libds clear;
%mp_getpk(&lib,ds=&ds,outds=&ds1)
proc sql noprint;
select pk_fields into: pk_fields from &ds1;
select coalescec(pk_fields,'_all_') into: pk_fields from &ds1;
data &ds2;
if 0 then set &libds;
@@ -7747,7 +7751,7 @@ data &ds2;
%if &charvars ^= %then %do i=1 %to %sysfunc(countw(&charvars));
%let col=%scan(&charvars,&i);
/* create random value based on observation number and colum length */
&col=substr(put(md5(_n_),$hex32.),1,%mf_getvarlen(&libds,&col));
&col=repeat(put(md5(cats(_n_)),$hex32.),%mf_getvarlen(&libds,&col)/32);
%end;
%let numvars=%mf_getvarlist(&libds,typefilter=N);