It's been over 10 years since I used SAS, so I'm very rusty and was hoping to see if there was a better way of doing this. I have a database that stores the Date of Birth (DOB) in a datetime informat, and I want to calculate the age using the today() date funciton. Both dates are stored differently internally (date vs datetime) and thus must be converted to a common denominator before any calculation can be done. Below is my program, and it works, but is there a better way of doing this? Thanks! data demog; set '/folders/myfolders/Protocols/ATC9701/SAS Data/demog.sas7bdat'; DOBTemp=put(DOB, datetime7.); DOBFinal = input(DOBTemp, date.); age = INT(YRDIF(DOBFinal,today(),'ACTUAL')); run;
... View more