Date: Fri, 18 Jan 2002 15:01:34 +0000
Reply-To: dkb@CIX.COMPULINK.CO.UK
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: dkb@CIX.COMPULINK.CO.UK
Organization: Nextra UK
Subject: Re: age calculations etc
Dennis Diskin posts:
> There are certainly several ways to do this. One would be:
> daystobd = mod(juldate(&refer),1000) - mod(juldate(birth),1000);
> This will give you a negative if &refer is past the birthday in the
current
> year.
I'm afraid there is a problem with using this technique: leap years.
My birth date, 5th June, was day number 156 of 1957. Because 2000 was a
leap year, if my referral date was 4th June 2000, that too would be day
number 156 and daystobd would incorrectly be calculated as 0 instead of
1.
Kind regards,
Dave
.
|