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 (July 2011, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 20 Jul 2011 11:30:11 -1000
Reply-To:     John.V.Parker@KP.ORG
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         John Parker <John.V.Parker@KP.ORG>
Subject:      Figuring out Age in Years, Months and Days
In-Reply-To:  <16FD64291482A34F995D2AF14A5C932C0B0AB4D6@MAIL002.prod.ds.russell.com>
Content-Type: text/plain; charset="US-ASCII"

Hi All,

I have a requirement to figure out Age at Death and it has to be expressed in Years, Months, Weeks and Days.

This is to accommodate individuals who may have died a short period after childbirth, etc.

In the past I have used code like this:

Age_at_death=%calcage(birth_date, death_date);

%macro CalcAge(BDtVar, RefDate) ;

floor ((intck('month',&BDTVar,&RefDate) - (day(&RefDate) < day(&BDTVar))) / 12)

%mend CalcAge ;

The DOB and DOD variables are formatted as MMDDYY10.

Has anyone done this type of calculation to this degree?

Many Thanks!

John


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