DATA Step, Macro, Functions and more

calculating age in SAS

Reply
Occasional Contributor hmc
Occasional Contributor
Posts: 5

calculating age in SAS

how to calulate age in SAS of particluar person the data is in excel

which is something like this 

name  bob

singh  1-jan-1980

anitha 6-mar-1991

 

Valued Guide
Posts: 765

Re: calculating age in SAS

[ Edited ]

Hi, using the attached XLS file ...

 

libname x 'z:\text.xls';

 

data want;
set x.'sheet1$'n;
age = yrdif(bob,today(),'age');
run;

 

libname x clear;

 

DATA SET: want

name        bob           age

singh     01JAN1980     37.4986
anitha    06MAR1991     26.3233

 

 

Ask a Question
Discussion stats
  • 1 reply
  • 149 views
  • 3 likes
  • 2 in conversation