feat: adding ability to define the target table for excel maps
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 13s

This commit is contained in:
zmaj
2024-01-11 18:11:22 +00:00
parent e747e6e4e7
commit c86fba9dc7
17 changed files with 248 additions and 93 deletions

View File

@ -14,7 +14,7 @@
<h5> xlmaprules </h5>
Filtered output of the dc.mpe_excel_map table
Filtered output of the dc.MPE_XLMAP_RULES table
|XLMAP_ID|XLMAP_RANGE_ID|XLMAP_SHEET|XLMAP_START|XLMAP_FINISH|
|---|---|---|---|---|
@ -26,7 +26,7 @@
|TARGET_DS|
|---|
|DCXXX.MPE_EXCEL_UPLOAD|
|DCXXX.MPE_XLMAP_DATA|
<h4> SAS Macros </h4>
@li mp_abort.sas
@ -42,6 +42,12 @@
%mpeinit()
data _null_;
set work.getxlmaps_in;
putlog (_all_)(=);
call symputx('xlmap_id',xlmap_id);
run;
proc sql noprint;
create table work.xlmaprules as
select xlmap_id
@ -49,28 +55,24 @@ create table work.xlmaprules as
,XLMAP_SHEET
,XLMAP_START
,XLMAP_FINISH
from &mpelib..mpe_excel_map
where &dc_dttmtfmt. lt tx_to
and xlmap_id in (select xlmap_id from work.getxlmaps_in)
from &mpelib..MPE_XLMAP_RULES
where &dc_dttmtfmt. lt tx_to and xlmap_id="&xlmap_id"
order by xlmap_sheet, xlmap_range_id;
%global target_ds;
select XLMAP_TARGETLIBDS into: target_ds
from &mpelib..MPE_XLMAP_INFO
where &dc_dttmtfmt. lt tx_to and xlmap_id="&xlmap_id";
%mp_abort(iftrue= (&syscc ne 0)
,mac=&_program..sas
,msg=%str(syscc=&syscc)
)
%let chk=0;
proc sql noprint;
select count(*) into: chk
from &mpelib..mpe_tables
where catx('.',libref,dsn) in (select xlmap_id from work.getxlmaps_in);
data work.xlmapinfo;
set work.getxlmaps_in;
length target_ds $32;
if &chk=0 then target_ds="&mpelib..MPE_EXCEL_UPLOAD";
else target_ds=xlmap_id;
keep target_ds;
target_ds=coalescec("&target_ds","&mpelib..MPE_XLMAP_DATA");
output;
stop;
run;
%webout(OPEN)