I am thinking a question: How to create a new variable by using informat. like : we have a informat like that:
proc format ;
invalue $agegrpcd
1 = '<18'
2 = '18 - 29'
3 = '30 - 39'
4 = '40 - 49'
5 = '50 - 65'
6 = '> 65'
. = 'Missing' ;run;
and a dataset like that:
data age;
input age 4. ;
cards;
22
34
13
45
64
33
;run;
now I want to have a dataset like this:
age agegroup
15 <18
25 18 - 29
33 30 - 39
45 40 - 49
64 50 - 65
77 > 65
Is there any way to put the numeric variable age into the character variable agegroup by using the informat I built? thanks.