Date: Wed, 20 Jul 2011 16:39:58 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: Figuring out Age in Years, Months and Days
In-Reply-To: <OF7BF1D843.90D28D8F-ON0A2578D3.007504AF-0A2578D3.00761ECA@kp.org>
Content-Type: text/plain; charset=ISO-8859-1
I haven't used this and don't know much about the subject but it may
be of some use. Place to start anyway.
CALL IS8601_CONVERT Routine
--------------------------------------------------------------------------------
Converts an ISO 8601 interval to datetime and duration values, or
converts datetime and duration values to an ISO 8601 interval.
On Wed, Jul 20, 2011 at 4:30 PM, John Parker <John.V.Parker@kp.org> wrote:
> 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
>
|