You can convert these type of text strings using the ANYDTDTM informat. Unfortunately it will not read the milliseconds. In the code below two methods are shown, one using the ANYDTDTM informat, the other uses a combination of two informats for the date and time part and then combine the date and seconds together using the DHMS function. data want; dateHave = "2015.03.03 11:19:41.440"; dateWant = input(dateHave, anydtdtm19.); dateWant2 = dhms( input(substr(dateHave, 1, 10), yymmdd10.) , 0 , 0 , input(substr(dateHave, 12), time16.) ); format dateWant: datetime22.3; run;
... View more