SAS Example 2: Calculating a Person’s Age
You can calculate a person’s age by using three arguments in the YRDIF function. The third argument, basis, must have a value of AGE:
data _null_;
sdate='16oct1998'd;
edate='16feb2010'd;
age=yrdif(sdate, edate, 'AGE');
put age= 'years';
run;