Date: Sun, 5 Dec 2004 15:56:44 +0100
Reply-To: Mariusz Gromada <mariusz.gromada@WP.PL>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mariusz Gromada <mariusz.gromada@WP.PL>
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Subject: Re: calculate age with month/year only
Content-Type: text/plain; charset=us-ascii; format=flowed
Nina Harris:
> Mariusz Gromada wrote:
>
>>Number of months between d1 and d2
>>= (y2-y1)*12 + m2-m1
>
>
> try and see what you get with
> data test;
> d1='2004-01';
> d2='2004-12';
> age=%months(d1,d2)/12;put age=;
> run;
>
>
??
%months('2004-01','2004-12') = 11
Are you thinking about dividing by 12? Maybe floor or ceil is needed? It
is quite obvious, so I didn't write that.
Regards,
Mariusz
--
Mariusz Gromada
|