diff --git a/all.sas b/all.sas index c9474ef..32c67c2 100644 --- a/all.sas +++ b/all.sas @@ -3718,7 +3718,8 @@ data _null_; %end; %else %if &flavour=PGSQL %then %do; if missing(&var) then put 'NULL'; - %if &applydttm=YES and "%substr(&vfmt,1,8)"="DATETIME" %then %do; + %if &applydttm=YES and "%substr(&vfmt.xxxxxxxx,1,8)"="DATETIME" + %then %do; else put "TIMESTAMP '" &var E8601DT25.6 "'"; %end; %else %do; diff --git a/base/mp_ds2inserts.sas b/base/mp_ds2inserts.sas index 0043ae2..073d8b6 100644 --- a/base/mp_ds2inserts.sas +++ b/base/mp_ds2inserts.sas @@ -152,7 +152,8 @@ data _null_; %end; %else %if &flavour=PGSQL %then %do; if missing(&var) then put 'NULL'; - %if &applydttm=YES and "%substr(&vfmt,1,8)"="DATETIME" %then %do; + %if &applydttm=YES and "%substr(&vfmt.xxxxxxxx,1,8)"="DATETIME" + %then %do; else put "TIMESTAMP '" &var E8601DT25.6 "'"; %end; %else %do;