feat: list versions of target tables (backend)
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Build / Build-and-ng-test (pull_request) Failing after 47s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Build / Build-and-ng-test (pull_request) Failing after 47s
				
			This commit is contained in:
		@@ -75,7 +75,9 @@ data basetable;
 | 
				
			|||||||
run;
 | 
					run;
 | 
				
			||||||
/* create results table */
 | 
					/* create results table */
 | 
				
			||||||
data results;
 | 
					data results;
 | 
				
			||||||
  format test $7. result $4. reason $50.; stop;
 | 
					  format test $7. result $4. reason $50.;
 | 
				
			||||||
 | 
					  call missing(of _all_);
 | 
				
			||||||
 | 
					  stop;
 | 
				
			||||||
run;
 | 
					run;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%put assigning lib..;
 | 
					%put assigning lib..;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,20 +14,19 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
%macro mpe_getversions(dclib,libref,ds,outds=work.mpe_getversions);
 | 
					%macro mpe_getversions(dclib,libref,ds,outds=work.mpe_getversions);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
proc sql;
 | 
					  proc sql;
 | 
				
			||||||
create table &outds as
 | 
					  create table &outds as
 | 
				
			||||||
  select csv_dir as LOAD_REF,
 | 
					    select a.csv_dir as LOAD_REF
 | 
				
			||||||
        user_nm  ,
 | 
					      ,a.user_nm
 | 
				
			||||||
        duration ,
 | 
					      ,put(a.processed_dttm,datetime19.) as VERSION_DTTM
 | 
				
			||||||
        processed_dttm as VERSION_DTTM,
 | 
					      ,a.reason_txt as VERSION_DESC
 | 
				
			||||||
        reason_txt as VERSION_DESC
 | 
					      ,b.changed_records
 | 
				
			||||||
  from &dclib..mpe_loads
 | 
					      ,b.new_records
 | 
				
			||||||
  where status='SUCCESS'
 | 
					      ,b.deleted_records
 | 
				
			||||||
    and csv_dir in (
 | 
					    from &dclib..mpe_loads a
 | 
				
			||||||
      select table_id
 | 
					    left join &dclib..MPE_DATALOADS(where=(libref="&libref" & dsn="&ds")) b
 | 
				
			||||||
      from &dclib..mpe_review
 | 
					    on a.csv_dir=b.etlsource
 | 
				
			||||||
      where base_table="&libref..&ds"
 | 
					    where a.approvals="&libref..&ds" and a.status='SUCCESS'
 | 
				
			||||||
    )
 | 
					    order by a.processed_dttm desc;
 | 
				
			||||||
  order by processed_dttm desc;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
%mend mpe_getversions;
 | 
					%mend mpe_getversions;
 | 
				
			||||||
@@ -41,6 +41,9 @@
 | 
				
			|||||||
  <h5> xl_rules </h5>
 | 
					  <h5> xl_rules </h5>
 | 
				
			||||||
  <h5> query </h5>
 | 
					  <h5> query </h5>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <h5> versions </h5>
 | 
				
			||||||
 | 
					  history of DC versions for this particular table
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <h4> SAS Macros </h4>
 | 
					  <h4> SAS Macros </h4>
 | 
				
			||||||
  @li dc_assignlib.sas
 | 
					  @li dc_assignlib.sas
 | 
				
			||||||
@@ -63,6 +66,7 @@
 | 
				
			|||||||
  @li mpe_columnlevelsecurity.sas
 | 
					  @li mpe_columnlevelsecurity.sas
 | 
				
			||||||
  @li mpe_dsmeta.sas
 | 
					  @li mpe_dsmeta.sas
 | 
				
			||||||
  @li mpe_getlabels.sas
 | 
					  @li mpe_getlabels.sas
 | 
				
			||||||
 | 
					  @li mpe_getversions.sas
 | 
				
			||||||
  @li mpe_filtermaster.sas
 | 
					  @li mpe_filtermaster.sas
 | 
				
			||||||
  @li mpe_runhook.sas
 | 
					  @li mpe_runhook.sas
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -672,6 +676,13 @@ run;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
%mpe_dsmeta(&libds, outds=dsmeta)
 | 
					%mpe_dsmeta(&libds, outds=dsmeta)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%mpe_getversions(&mpelib,
 | 
				
			||||||
 | 
					  %scan(&orig_libds,1,.),
 | 
				
			||||||
 | 
					  %scan(&orig_libds,2,.),
 | 
				
			||||||
 | 
					  outds=versions
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* send to the client */
 | 
					/* send to the client */
 | 
				
			||||||
%webout(OPEN)
 | 
					%webout(OPEN)
 | 
				
			||||||
%webout(OBJ,approvers)
 | 
					%webout(OBJ,approvers)
 | 
				
			||||||
@@ -683,6 +694,7 @@ run;
 | 
				
			|||||||
%webout(OBJ,query)
 | 
					%webout(OBJ,query)
 | 
				
			||||||
%webout(OBJ,sasdata1,fmt=N,missing=STRING,showmeta=YES,dslabel=sasdata)
 | 
					%webout(OBJ,sasdata1,fmt=N,missing=STRING,showmeta=YES,dslabel=sasdata)
 | 
				
			||||||
%webout(OBJ,sasparams)
 | 
					%webout(OBJ,sasparams)
 | 
				
			||||||
 | 
					%webout(OBJ,versions)
 | 
				
			||||||
%webout(OBJ,xl_rules)
 | 
					%webout(OBJ,xl_rules)
 | 
				
			||||||
%webout(CLOSE)
 | 
					%webout(CLOSE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,6 +31,9 @@
 | 
				
			|||||||
  @li TABLEURI
 | 
					  @li TABLEURI
 | 
				
			||||||
  @li VARS
 | 
					  @li VARS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <h5> versions </h5>
 | 
				
			||||||
 | 
					  history of DC versions for this particular table
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <h5> viewdata </h5>
 | 
					  <h5> viewdata </h5>
 | 
				
			||||||
  The raw data from the target table.
 | 
					  The raw data from the target table.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -51,6 +54,7 @@
 | 
				
			|||||||
  @li mp_validatecol.sas
 | 
					  @li mp_validatecol.sas
 | 
				
			||||||
  @li mpe_columnlevelsecurity.sas
 | 
					  @li mpe_columnlevelsecurity.sas
 | 
				
			||||||
  @li mpe_dsmeta.sas
 | 
					  @li mpe_dsmeta.sas
 | 
				
			||||||
 | 
					  @li mpe_getversions.sas
 | 
				
			||||||
  @li mpe_filtermaster.sas
 | 
					  @li mpe_filtermaster.sas
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -87,6 +91,7 @@ data work.intest;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  /* check if the request is for a format catalog */
 | 
					  /* check if the request is for a format catalog */
 | 
				
			||||||
  if substr(cats(reverse(libds)),1,3)=:'CF-' then do;
 | 
					  if substr(cats(reverse(libds)),1,3)=:'CF-' then do;
 | 
				
			||||||
 | 
					    call symputx('orig_libds',libds);
 | 
				
			||||||
    libds=scan(libds,1,'-');
 | 
					    libds=scan(libds,1,'-');
 | 
				
			||||||
    putlog "Format Catalog Captured";
 | 
					    putlog "Format Catalog Captured";
 | 
				
			||||||
    call symputx('fmt_ind',1);
 | 
					    call symputx('fmt_ind',1);
 | 
				
			||||||
@@ -353,12 +358,19 @@ run;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
%mpe_dsmeta(&libds, outds=dsmeta)
 | 
					%mpe_dsmeta(&libds, outds=dsmeta)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%mpe_getversions(&mpelib,
 | 
				
			||||||
 | 
					  %scan(&orig_libds,1,.),
 | 
				
			||||||
 | 
					  %scan(&orig_libds,2,.),
 | 
				
			||||||
 | 
					  outds=versions
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%webout(OPEN)
 | 
					%webout(OPEN)
 | 
				
			||||||
%webout(OBJ,cls_rules)
 | 
					%webout(OBJ,cls_rules)
 | 
				
			||||||
%webout(OBJ,cols)
 | 
					%webout(OBJ,cols)
 | 
				
			||||||
%webout(OBJ,dsmeta)
 | 
					%webout(OBJ,dsmeta)
 | 
				
			||||||
%webout(OBJ,query)
 | 
					%webout(OBJ,query)
 | 
				
			||||||
%webout(OBJ,sasparams)
 | 
					%webout(OBJ,sasparams)
 | 
				
			||||||
 | 
					%webout(OBJ,versions)
 | 
				
			||||||
%webout(OBJ,viewData2,fmt=Y,missing=STRING,showmeta=YES,dslabel=viewdata)
 | 
					%webout(OBJ,viewData2,fmt=Y,missing=STRING,showmeta=YES,dslabel=viewdata)
 | 
				
			||||||
%webout(CLOSE)
 | 
					%webout(CLOSE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user