diff --git a/base/mf_fmtdttm.sas b/base/mf_fmtdttm.sas
index 477c0f3..1cd1aeb 100644
--- a/base/mf_fmtdttm.sas
+++ b/base/mf_fmtdttm.sas
@@ -5,9 +5,21 @@
(https://datacontroller.io) deployments, the E8601DT26.6 datetime format has
the widest support when it comes to pass-through SQL queries.
- However, it is not supported in WPS or early versions of SAS 9 (M3 and below).
+ However, it is not supported in WPS or early versions of SAS 9 (M3 and below)
+ when used as a datetime literal, eg:
- This macro will therefore return the appropriate format based on the runtime.
+ data _null_;
+ demo="%sysfunc(datetime(),E8601DT26.6)"dt;
+ demo=;
+ run;
+
+ This macro will therefore return DATEITME19.3 as an alternative format
+ based on the runtime environment so that it can be used in such cases, eg:
+
+ data _null_;
+ demo="%sysfunc(datetime(),%mf_fmtdttm())"dt;
+ demo=;
+ run;
Related Macros
@li mf_fmtdttm.test.sas
diff --git a/base/mp_lockanytable.sas b/base/mp_lockanytable.sas
index 40ce710..aa8c3ff 100644
--- a/base/mp_lockanytable.sas
+++ b/base/mp_lockanytable.sas
@@ -22,6 +22,7 @@
@param [in] loop_secs= (1) Seconds to wait between each lock attempt
SAS Macros
+ @li mf_fmtdttm.sas
@li mp_abort.sas
@li mp_lockfilecheck.sas
@li mf_getuser.sas
@@ -111,7 +112,7 @@ run;
LOCK_LIB ="&lib";
LOCK_DS="&ds";
LOCK_STATUS_CD='LOCKED';
- LOCK_START_DTTM="%sysfunc(datetime(),E8601DT26.6)"dt;
+ LOCK_START_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt;
LOCK_USER_NM="&user";
LOCK_PID="&sysjobid";
LOCK_REF="&ref";
@@ -131,7 +132,7 @@ run;
proc sql;
update &ctl_ds
set LOCK_STATUS_CD='LOCKED'
- , LOCK_START_DTTM="%sysfunc(datetime(),E8601DT26.6)"dt
+ , LOCK_START_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
, LOCK_USER_NM="&user"
, LOCK_PID="&sysjobid"
, LOCK_REF="&ref"
@@ -206,7 +207,7 @@ run;
proc sql;
update &ctl_ds
set LOCK_STATUS_CD='UNLOCKED'
- , LOCK_END_DTTM="%sysfunc(datetime(),E8601DT26.6)"dt
+ , LOCK_END_DTTM="%sysfunc(datetime(),%mf_fmtdttm())"dt
, LOCK_USER_NM="&user"
, LOCK_PID="&sysjobid"
, LOCK_REF="&ref"
diff --git a/base/mp_retainedkey.sas b/base/mp_retainedkey.sas
index 8d183bd..bcebada 100644
--- a/base/mp_retainedkey.sas
+++ b/base/mp_retainedkey.sas
@@ -58,6 +58,7 @@
SAS Macros
@li mf_existvar.sas
+ @li mf_fmtdttm.sas
@li mf_getquotedstr.sas
@li mf_getuniquename.sas
@li mf_nobs.sas
@@ -217,12 +218,12 @@ quit;
set keytable="&base_libds"
,keycolumn="&retained_key"
,max_key=%eval(&maxkey+&newkey_cnt)
- ,processed_dttm="%sysfunc(datetime(),E8601DT26.6)"dt;
+ ,processed_dttm="%sysfunc(datetime(),%mf_fmtdttm())"dt;
%end;
%else %do;
update &maxkeytable
set max_key=%eval(&maxkey+&newkey_cnt)
- ,processed_dttm="%sysfunc(datetime(),E8601DT26.6)"dt
+ ,processed_dttm="%sysfunc(datetime(),%mf_fmtdttm())"dt
where keytable="&base_libds";
%end;
%mp_lockanytable(UNLOCK