Sukumar, as you ahve presumably discovered, to the best of my knowledge SAS
does not have an informat corresponding to that Datetime format. I would
therefore suggest that you read the datetime value in as a character value
(length=23), extract the date and time parts from that character string as
SAS date and time variables, then combine the SAS date value with the
hours, minutes and seconds extracted from the SAS time variable to give you
a single SAS datetine variable containing the value from the raw data:
data test (drop = dtIn date1 time1) ;
input dtIn $23. ;
date1 = input(substr(dtIn,1,10), yymmdd10.) ;
time1 = input(substr(dtIn,12), time12.) ;
DateTime1 = dhms(date1,hour(time1),minute(time1),second(time1)) ;
cards ;
2007-10-18 09:50:50.000
2008-04-15 12:15:50.123
1975-06-21 15:12:12.345
;
run ;
proc print data=test noobs ;
format DateTime1 datetime20.3 ;
run ;;
I have used the datetime20.3 format to display the contents of the created
SAS datetime variable, but you could obviously use any format you
wished. The output of the above print procedure is:
DateTime1
18OCT07:09:50:50.000
15APR08:12:15:50.123
21JUN75:15:12:12.345
Does that acgieve what you want?
Kind Regards,
John
----------------------------------------------------------------
Dr John Whittington, Voice: +44 (0) 1296 730225
Mediscience Services Fax: +44 (0) 1296 738893
Twyford Manor, Twyford, E-mail: Joh...@mediscience.co.uk
Buckingham MK18 4EL, UK
----------------------------------------------------------------