From f468f60ae1e5512b3c56994421e78cbcb44cdb4b Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Tue, 24 Aug 2021 20:51:29 +0300 Subject: [PATCH] fix: substr issue in mp_ds2inserts. Closes #68 --- all.sas | 3 ++- base/mp_ds2inserts.sas | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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;