feat: list versions of target tables (backend)
Build / Build-and-ng-test (pull_request) Failing after 47s Details

This commit is contained in:
^ 2024-03-25 12:37:11 +00:00
parent 633e35338d
commit f8a14d4bde
4 changed files with 41 additions and 16 deletions

View File

@ -75,7 +75,9 @@ data basetable;
run;
/* create results table */
data results;
format test $7. result $4. reason $50.; stop;
format test $7. result $4. reason $50.;
call missing(of _all_);
stop;
run;
%put assigning lib..;

View File

@ -14,20 +14,19 @@
%macro mpe_getversions(dclib,libref,ds,outds=work.mpe_getversions);
proc sql;
create table &outds as
select csv_dir as LOAD_REF,
user_nm ,
duration ,
processed_dttm as VERSION_DTTM,
reason_txt as VERSION_DESC
from &dclib..mpe_loads
where status='SUCCESS'
and csv_dir in (
select table_id
from &dclib..mpe_review
where base_table="&libref..&ds"
)
order by processed_dttm desc;
proc sql;
create table &outds as
select a.csv_dir as LOAD_REF
,a.user_nm
,put(a.processed_dttm,datetime19.) as VERSION_DTTM
,a.reason_txt as VERSION_DESC
,b.changed_records
,b.new_records
,b.deleted_records
from &dclib..mpe_loads a
left join &dclib..MPE_DATALOADS(where=(libref="&libref" & dsn="&ds")) b
on a.csv_dir=b.etlsource
where a.approvals="&libref..&ds" and a.status='SUCCESS'
order by a.processed_dttm desc;
%mend mpe_getversions;

View File

@ -41,6 +41,9 @@
<h5> xl_rules </h5>
<h5> query </h5>
<h5> versions </h5>
history of DC versions for this particular table
<h4> SAS Macros </h4>
@li dc_assignlib.sas
@ -63,6 +66,7 @@
@li mpe_columnlevelsecurity.sas
@li mpe_dsmeta.sas
@li mpe_getlabels.sas
@li mpe_getversions.sas
@li mpe_filtermaster.sas
@li mpe_runhook.sas
@ -672,6 +676,13 @@ run;
%mpe_dsmeta(&libds, outds=dsmeta)
%mpe_getversions(&mpelib,
%scan(&orig_libds,1,.),
%scan(&orig_libds,2,.),
outds=versions
)
/* send to the client */
%webout(OPEN)
%webout(OBJ,approvers)
@ -683,6 +694,7 @@ run;
%webout(OBJ,query)
%webout(OBJ,sasdata1,fmt=N,missing=STRING,showmeta=YES,dslabel=sasdata)
%webout(OBJ,sasparams)
%webout(OBJ,versions)
%webout(OBJ,xl_rules)
%webout(CLOSE)

View File

@ -31,6 +31,9 @@
@li TABLEURI
@li VARS
<h5> versions </h5>
history of DC versions for this particular table
<h5> viewdata </h5>
The raw data from the target table.
@ -51,6 +54,7 @@
@li mp_validatecol.sas
@li mpe_columnlevelsecurity.sas
@li mpe_dsmeta.sas
@li mpe_getversions.sas
@li mpe_filtermaster.sas
@ -87,6 +91,7 @@ data work.intest;
/* check if the request is for a format catalog */
if substr(cats(reverse(libds)),1,3)=:'CF-' then do;
call symputx('orig_libds',libds);
libds=scan(libds,1,'-');
putlog "Format Catalog Captured";
call symputx('fmt_ind',1);
@ -353,12 +358,19 @@ run;
%mpe_dsmeta(&libds, outds=dsmeta)
%mpe_getversions(&mpelib,
%scan(&orig_libds,1,.),
%scan(&orig_libds,2,.),
outds=versions
)
%webout(OPEN)
%webout(OBJ,cls_rules)
%webout(OBJ,cols)
%webout(OBJ,dsmeta)
%webout(OBJ,query)
%webout(OBJ,sasparams)
%webout(OBJ,versions)
%webout(OBJ,viewData2,fmt=Y,missing=STRING,showmeta=YES,dslabel=viewdata)
%webout(CLOSE)