Hi again, @kiranv_, @Tom, and @Reeza, I have just tried to use the new variable in an artimethic computation even though I have change the Char format to a Numeric format, but it did not work. Even if I change it to Best format, it still doesn't work. The reason why I have tried to change it again to Best is that there was another variables that is in the Best format and the computation worked well. data have(rename= (ex_post_date1= ex_post_date));
set have;
ex_post_original=ex_post_date;
ex_post_date1 = input(ex_post_date,date9.);
drop ex_post_date;
format ex_post_date1 yymmddn8.;
run;
data have;
set have;
numeric=put(ex_post_date1,best8.);
format ex_post_date1 best8.;
run;
*Here is the math computation;
data want;
set have;
year=int(ex_post_date/10000);
month=int(ex_post_date/100)-year*100;
day=ex_post_date-year*10000-month*100;
NEED_num=mdy(month,day,year);
format NEED_num mmddyy10.;
drop year month day;
run;
... View more