Dear reader, I have a question regarding converting date and time in a text format (Excel) into a separate date and timefield. I do not want to touch or modify the Excel, the date and time are a Text field, e.g. 2021-02-13T09:46. I manage to take out the date part and convert it to a DATE9. format. But as for the time this does not work. Is there a solution how to best get my results? I want SAMPDT_CC as DATE9, which works and SAMPTM_CC as TIME5.2 and I cannot manage to get this.. Here is code (also uploaded) PROC IMPORT DATAFILE="C:\.......\SAMPLEDATETIME.xlsx" OUT=BIOMCC DBMS=xlsx REPLACE; RUN; DATA BIOMCC2; SET BIOMCC; DT=SUBSTR(SAMPLE_DATE,1,10); TM=SUBSTR(SAMPLE_DATE,12,5); DROP SAMPLE_DATE; SAMPDT_CC=INPUT(DT,YYMMDD10.); SAMPTM_CC=INPUT(TM,HHMM5.2); FORMAT SAMPDT_CC DATE9.; FORMAT SAMPTM_CC TIME5.; run; Thanks for support!! Johan
... View more