Hi guys. New SAS user here. I need some help regarding reading a DATETIME format variable into SAS. The datafile's name is "test.txt". The variables are seprated by tab: 24-Jun-2012 03:39:00 79 I used DATETIME format to read the first variable with length 20 as follows: data testing2; infile 'C:\test.txt' DLM='09'X DSD MISSOVER; input date DATETIME20. number2; RUN; It does not work. SAS read the first variable correctly, but read second variable as missing value. If I add an +1 in the end of the first variable, it works. I don't know why. data testing2; infile 'C:\test.txt' DLM='09'X DSD MISSOVER; input date DATETIME20. number2; RUN; If I use the colon modifier and keep the length as 20 it works: data testing2; infile 'C:\test.txt' DLM='09'X DSD MISSOVER; input date :DATETIME20. number2; RUN; If I use the colon modifier and use the length as 15 it still works: infile 'C:\test.txt' DLM='09'X DSD MISSOVER; input date :DATETIME15. number2; RUN; I'm so confused. The length of the first variable is 20, so :DATETIME20. should work but it doesn't. Why adding +1 or use colon modifier (even at length 15) work? Also, am i correct on the following statement: Formatted input: SAS Pointer moves to the next column after reading the variable with formatted input. So if the delimiter is tab, after reading the variable with formatted input, the pointer is actually at the position of TAB. In order to read next variable, I need to use +1 to skip the TAB. Colon modifier: SAS Pointer moves to the beginning position of next variable after reading the variable with colon modifier. Please help! Thanks!!!
... View more