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
|