lastmodificationdate is already a datetime and thus stored as numeric. Hence, input(lastmodificationdate, datetime18.) won't work as it attempts to convert a string of the form "ddmmmyy:hh:mm:ss" into a numeric value representing the number of seconds since 01JAN1960:00:00:00 (which is what your variable already is). Data Null had the appropriate answer, all you needed was to attribute an appropriate format to the newly created variable after using timepart. data match2.eurodailynew; set match2.eurodaily; time=timepart(LastModificationDate); format time time8.; run; Should do the appropriate conversion. All date, time and datetime format variables are stored internally as a numeric count. Either the number of days since 01jan1960, the number of seconds since 00:00:00.00 or the number of seconds since 01jan1960:00:00:00.00 respectively. Any new variable created from manipulation of these dates will return a numeric value with a similar count. You simply need to tell SAS that you want it to be represented as a date/time or datetime format via a format statement after creating the variable. Vince
... View more