It seems you should be most if not all the way there. For me there are two main ways you can use with the date being in a string, firstly input and date part, and secndly substring and input. Here is some code demonstrating what i mean. data source_ds; input race_date $20.; datalines; 12may2005:00:00:00 04sep2006:00:00:00 27jan2005:00:00:00 ; run; data target_ds; set source_ds; format new_race_date date9.; /* date part method */ new_race_date=datepart(input(race_date,datetime18.)); /* substring method */ new_race_date=input(substr(race_date,1,9),date9.); run;
... View more