Hi guys, I am trying to import a csv file which is delimited by '|' and my dates are all in this format "2015-10-31 00:00". Hence, I code using this: data want;
%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
infile 'File path' delimiter = '|' MISSOVER DSD lrecl=32767 firstobs=2 ;
informat PostDate ANYDTDTM32. ;
informat OpenDate ANYDTDTM32. ;
format PostDate DATE9. ;
format OpenDate DATETIME16. ;
input
PostDate
OpenDate
;
if _ERROR_ then call symput('_EFIERR_',1); /* set ERROR detection macro variable */
run; All my other fields are importing correctly but only the dates are impacted. So for the PostDate, I do not want the time, but for the OpenDate, I will want the time. I have compared the number of variables but all tallied up. So I'm really confused about this problem and there are no error messages in the Log to indicate what is the error. If I'm using PROC IMPORT, it is fine. But there are empty date fields, which will make it Character instead of Numeric. Hence, I choose to use infile for importing the file. Appreciate if anyone can help me!
... View more