Tips:Calculating Ages

From sasCommunity

Jump to: navigation, search

Because of leap years, it is not possible to accurately calculate a person's colloquial age on a particular date using just simple arithmetic operations. However, SAS date functions can be employed to get a correct result. The formula is

 age = floor((intck('month',birth,somedate) - (day(somedate) < day(birth))) / 12);

....see also

Personal tools