The reason you only get correct values for last group is because when you use multiple IF statements with the same variable then the result from the LAST one is kept. With IF statements you would use ELSE so that when the previous test was false it go to the next one.
DATA work.import;
SET work.import;
IF (AGE >=0) AND (AGE<=9) THEN NAGE= "0-9 YEARS";
Else IF (AGE >=10) AND (AGE<=17) THEN NAGE= "10-17 YEARS";
Else IF (AGE >=18) AND (AGE<=35) THEN NAGE= "18-35 YEARS";
Else IF (AGE >=36) AND (AGE<=50) THEN NAGE= "36-50 YEARS";
Else IF (AGE >=51) AND (AGE<=64) THEN NAGE= "51-64 YEARS";
Else IF (AGE >=65) THEN NAGE= "65+";
RUN;
And again, using
Data work.import;
set work.import.
Is just asking for problems as this replaces the source data set every time you use the same data set.
All you need is one typo like
IF Age > 65;
to lose a lot of data.