Hi @Reeza and @Tom,
1. You're right. As a result of this experiment, I realized that I have old and young folks with a cancer hospitalized between 1995-2013 with age range of 7-107yrs. Code below shows how I tested and variable "test" has only 0,1 values depending whether they were hospitalized before or after their birthday.
2. Suggested formats didn't work but either substr and substrn identically worked out.
3. Critical thinking was required to question, perhaps folks I have here might just be old vs very young (7-107yrs).
Can I select two answers for SOLUTIONS? I truly appreciate your help indeed.
dy = substrn(left(dob), 1, 4);
dm = substrn(left(dob), 5, 2);
difference=hospitalized_year-dy;
cage=input(AGE,3.);
test=difference-cage;