@abdulla wrote:
No, it doesn't work. I got 2.01E7. Also I am continuously getting the following msg.
ERROR: There was a problem with the format so BEST. was used.
If your value is printing as 2.01E7 then it is neither a date (number of days since 1960) or a datetime (number of seconds since 1960).
269 data test;
270 x= 2.01E7 ;
271 put 'COMMA15. ' @13 x comma15. ;
272 put 'DATE9. ' @13 x date9. ;
273 put 'DATETIME20. ' @13 x datetime20. ;
274 run;
COMMA15. 20,100,000
DATE9. *********
DATETIME20. 20AUG1960:15:20:00
Looks like you might have stored you dates as numbers where the tens and ones place represent the day of the month, etc.
To convert them into actual dates use could use an INPUT() function. You will first need to convert them into a string.
data want ;
set have;
date = input(put(date,8.),yymmdd8.);
format date yymmdd10. ;
run;