07-06-2015 11:50 AM
I have a dataset in which I've created an age variable using a date of birth variable and an "age as of" variable (which I created as well), like this:
/*Calculate age from DOB*/
age=floor(yrdif(datepart(dob), ageasof, age));
The code runs fine and seems to calculate age correctly; however, I get a message after the second step saying that Numeric values have been converted to character values. I want age to be a numeric variable, so this is problematic. However, when I run a proc contents, it says age is already numeric, and when I go to the next step which uses values of age to create age categories, I treat age as numeric and it works fine. I'm confused about why I'm getting the message re: age being converted to character values when that doesn't actually seem to be the case.
Any help is much appreciated.
Need further help from the community? Please ask a new question.