You are still not communicating clearly.
If the actual value is 18DEC2023:18:48:18 then you have a CHARACTER variable.
The most likely cause for getting age of 53 is that you messed up the order of the arguments and which one had DATE values versus DATETIME values so that you ended up calculating the number of years since 1960. So 53 years would be some time in 2013.
Example:
73 data _null_; 74 dob = '01JUN2013'd; 75 date = '01JUN2023'd ; * DATE value, not DATETIME ; 76 age = yrdif(datepart(date),dob); 77 put (_all_) (=/); 78 run; dob=19510 date=23162 age=53.41369863
For this example the real formula should be yrdif(dob,date) which would yield age=10.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.