Date: Wed, 19 Sep 2007 16:18:09 -0700
Reply-To: Adriano Rodrigues - Instituto GPP <adriano@GPP.COM.BR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Adriano Rodrigues - Instituto GPP <adriano@GPP.COM.BR>
Subject: RES: Finding actual age
In-Reply-To: <Pine.GSO.4.58.0709191453240.17906@leukothea>
Content-Type: text/plain; charset="us-ascii"
Thanks, i am getting almost what I want, but never work with this functions,
see what happened (wrong ages).
I fell must change something...looks like SAS think I am in 1992...
data tt;
set xx;
age = floor((intck('month',born,today())
- (day(today()) < day(born))) / 12);
proc print;
var id born age;
run;
Obs id born age
1 26 03/11/78 15
2 16 05/20/80 13
3 18 07/03/81 12
4 11 09/02/87 6
5 12 12/01/78 14
6 14 04/19/84 9
7 19 09/14/82 11
8 21 09/30/83 9
9 20 06/16/89 4
10 28 11/11/72 20
11 27 04/16/82 11
12 17 11/28/79 13
13 15 04/27/81 12
14 13 08/08/79 14
15 22 02/10/88 5
16 23 12/22/78 14
17 24 02/20/84 9
18 25 01/21/77 16
Thanks in advance,
Adriano
|