LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 18 Jan 2002 08:23:23 -0500
Reply-To:     diskin.dennis@KENDLE.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         diskin.dennis@KENDLE.COM
Subject:      Re: age calculations etc
Comments: To: David Yeates <david.yeates@UHCE.OX.AC.UK>
Content-type: text/plain; charset=us-ascii

David,

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. Is this what you wanted ?

HTH, Dennis Diskin

From: David Yeates <david.yeates@UHCE.OX.AC.UK>@LISTSERV.UGA.EDU> on 01/18/2002 07:23 AM

Please respond to David Yeates <david.yeates@UHCE.OX.AC.UK>

Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>

To: SAS-L@LISTSERV.UGA.EDU cc:

Subject: age calculations etc

Hi All,

I have been puzzling over the following...

Given the birth-date and another reference date refer-date I can calculate the exact age using that old favourite macro

%macro age(birth, refer); int((intck('month',&birth,&refer)-(day(&birth)>day(&refer)))/12); %mend age;

where &birth and &refer are the two dates. Now what I need having calculated the age is exactly how many days are there from the birthday in the year corresponding to refer-date to refer-date itself.

Any ideas very welcome.

Kind regards David UHCE, Oxford University


Back to: Top of message | Previous page | Main SAS-L page