
Rick A. answered 03/26/19
Experienced SAS Professional
Not sure if this is what you are looking for, but SAS stores all date values as the number of days since 1/1/1960 and the informat ANYDTDTEw. can handle almost any format of date (and time) value being read, and extract the date.
So here is an example:
data raa;
options datestyle=DMY; /* otherwise 10-6-09 is ambiguous in the 4th dataline */
format i_formatted ddmmyy10.;
informat i anydtdte21.;
input i ;
i_formatted=i;
datalines;
10JUN2009
20090610
10JUN2009 15:33:20
10-6-09
;
run;