I believe the original question was:
----------------------------------------
Hello,
I am new hand in SAS and I met a trouble when I used the SAS to read the data.csv files, the "time" was not correctly read, for example, "5/31/2007 23:00" become as "5/31/2007". How could I read the "time" correctly?
Thank you very much!
Timexxxx Value
5/31/2007 23:00,1789
1/11/2007 0:10,2631
11/11/2007 0:20,1343
11/12/2007 10:20,2343
-------------------------------------------------
To answer this, one way would be the following
data metrics;
length datestring $16;
infile datafile dlm=',' ;
input datestring $ value;
date = input(scan(datestring,1," "), mmddyy10.);
time = input(scan(datestring,2," "), hhmm.);
hh = hour(time);
mm = minute(time);
datetimestamp = dhms(date,hh,mm,00);
drop hh mm;
run;
quit;