@Reeza wrote:
Add an IF statement to your code to only calculate age when DOB is not missing.
For example, you could introduce the IF condition n(dob, dov)=2, which means "dob and dov are not missing":
if first.subject then do;
if n(dob, dov)=2 then age= (your age formula here);
else age=.;
end;
Are you sure you want 'actual' as the third argument of YRDIF given that 'age' is an option designed for calculating a person's age?
... View more