diff --git a/sas/sasjs/macros/mpe_refreshcatalogs.sas b/sas/sasjs/macros/mpe_refreshcatalogs.sas
index 0ddeb5f..6caa470 100644
--- a/sas/sasjs/macros/mpe_refreshcatalogs.sas
+++ b/sas/sasjs/macros/mpe_refreshcatalogs.sas
@@ -3,14 +3,15 @@
@brief Refreshes the data catalog
@details Assumes library is already assigned.
- @param [in] etlsource identifies this load in the MPE_DATALOADS audit row.
+ @param [in] etlsource= (0) Defaults to %mf_getuniquename(prefix=refreshcatalogs); it
+ identifies this load in the MPE_DATALOADS audit row.
Usage:
%mpe_refreshcatalogs(sashelp)
SAS Macros
- @li mf_uid.sas
+ @li mf_getuniquename.sas
@li mp_abort.sas
@li bitemporal_dataloader.sas
@@ -20,11 +21,11 @@
**/
%macro mpe_refreshcatalogs(lib,cat=#all
- ,etlsource=refreshcatalog:mpe_refreshcatalogs:%mf_uid()
+ ,etlsource=0
);
%let lib=%upcase(&lib);
%let cat=%upcase(&cat);
-%if "&etlsource"="0" %then %let etlsource=refreshcatalog:%sysmacroname:%mf_uid();
+%if "&etlsource"="0" %then %let etlsource=%mf_getuniquename(prefix=refreshcatalogs);
%put running &sysmacroname &lib for &cat;
proc sql;
diff --git a/sas/sasjs/macros/mpe_refreshlibs.sas b/sas/sasjs/macros/mpe_refreshlibs.sas
index 475d87e..b17179f 100644
--- a/sas/sasjs/macros/mpe_refreshlibs.sas
+++ b/sas/sasjs/macros/mpe_refreshlibs.sas
@@ -3,12 +3,12 @@
@brief Refreshes the library data catalog
@details
- @param [in] etlsource= (refreshcatalog::%mf_uid()) identifies this load
+ @param [in] etlsource= (0) Defaults to %mf_getuniquename(prefix=refreshlibs), identifies this load
in the MPE_DATALOADS audit row. That table is keyed on etlsource together
with processed_dttm, libref and dsn, so the uid keeps each load distinct.
SAS Macros
- @li mf_uid.sas
+ @li mf_getuniquename.sas
@li dc_getlibs.sas
@li mf_getplatform.sas
@li bitemporal_dataloader.sas
@@ -22,8 +22,13 @@
**/
%macro mpe_refreshlibs(lib=0
- ,etlsource=refreshcatalog:mpe_refreshlibs:%mf_uid()
+ ,etlsource=0
);
+/* a default of 0 rather than a %mf_uid() expression: a default is
+ resolved when the macro is compiled, so it would be one value for the
+ whole session and the audit folder below it would collide on the
+ second call - as it did between the refresh steps of one run */
+%if "&etlsource"="0" %then %let etlsource=%mf_getuniquename(prefix=refreshlibs);
%dc_getlibs(outds=work.mm_getLibs)
proc sort data=mm_getlibs;
diff --git a/sas/sasjs/macros/mpe_refreshtables.sas b/sas/sasjs/macros/mpe_refreshtables.sas
index 58fe452..928f5cb 100644
--- a/sas/sasjs/macros/mpe_refreshtables.sas
+++ b/sas/sasjs/macros/mpe_refreshtables.sas
@@ -3,7 +3,7 @@
@brief Refreshes the data catalog
@details
- @param [in] etlsource= (refreshcatalog::%mf_uid()) identifies this load
+ @param [in] etlsource= (0) Defaults to %mf_getuniquename(prefix=refreshtables), identifies this load
in the MPE_DATALOADS audit row. That table is keyed on etlsource together
with processed_dttm, libref and dsn, so the uid keeps each load distinct.
Usage:
@@ -11,7 +11,7 @@
%mpe_refreshtables(sashelp)
SAS Macros
- @li mf_uid.sas
+ @li mf_getuniquename.sas
@li mp_abort.sas
@li bitemporal_dataloader.sas
@li mf_existfeature.sas
@@ -24,8 +24,13 @@
**/
%macro mpe_refreshtables(lib,ds=#all
- ,etlsource=refreshcatalog:mpe_refreshtables:%mf_uid()
+ ,etlsource=0
);
+/* a default of 0 rather than a %mf_uid() expression: a default is
+ resolved when the macro is compiled, so it would be one value for the
+ whole session and the audit folder below it would collide on the
+ second call - as it did between the refresh steps of one run */
+%if "&etlsource"="0" %then %let etlsource=%mf_getuniquename(prefix=refreshtables);
%let lib=%upcase(&lib);
%let ds=%upcase(&ds);
%local engine; %let engine=%mf_getengine(&lib);