Dear all,
suppose to have two dates:
Date of Birth: 01JUL1936
Date of Admission: 03MAR2016
The age at admission calculated as: (Date of Admission-Date of Birth)/365.25 = 79.67.
Since I need an integer, should this age be rounded to 80 or not? If yes, how?
Thank you in advance
Should it be rounded? Well, that's up to you, it depends on how you intend to use the result.
How to round it?
age_rounded = round(yrdif(date_of_birth,date_of_admission,'AGE'));
View solution in original post
Good point, @Kurt_Bremser about not rounding up
To round down, you would use the FLOOR function in SAS
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Latest Updates
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.