I am new to SAS so I need some help.
I have a database that has a summary of members in age/gender categories. However the age/gender categories are in columns and I need to rotate the data. So that in one column I have membership and in the other column I have the age/gender category that goes with that membership.
This is what I did...
data util.asb2 (drop=C0000 C0101 C0209 C1017 F1819 F2024 F2529 F3034 F3539 F4044 F4549
F5054 F5559 F6064 F65Up M1819 M2024 M2529 M3034 M3539 M4044 M4549
M5054 M5559 M6064 M65Up);
set util.asb;
array AgeSex{26} C0000 C0101 C0209 C1017 F1819 F2024 F2529 F3034 F3539 F4044 F4549
F5054 F5559 F6064 F65Up M1819 M2024 M2529 M3034 M3539 M4044 M4549
M5054 M5559 M6064 M65Up ;
do ASCat=1 to 26;
Mems= AgeSex{ASCat};
output;
end;
run;
This worked however in ASCat column I get numbers from 1 to 26. What I would really like to get is the column names (i.e. C000, C0101). What is the best way to do accomplish this?
I have a database that has a summary of members in age/gender categories. However the age/gender categories are in columns and I need to rotate the data. So that in one column I have membership and in the other column I have the age/gender category that goes with that membership.
This is what I did...
data util.asb2 (drop=C0000 C0101 C0209 C1017 F1819 F2024 F2529 F3034 F3539 F4044 F4549
F5054 F5559 F6064 F65Up M1819 M2024 M2529 M3034 M3539 M4044 M4549
M5054 M5559 M6064 M65Up);
set util.asb;
array AgeSex{26} C0000 C0101 C0209 C1017 F1819 F2024 F2529 F3034 F3539 F4044 F4549
F5054 F5559 F6064 F65Up M1819 M2024 M2529 M3034 M3539 M4044 M4549
M5054 M5559 M6064 M65Up ;
do ASCat=1 to 26;
Mems= AgeSex{ASCat};
output;
end;
run;
This worked however in ASCat column I get numbers from 1 to 26. What I would really like to get is the column names (i.e. C000, C0101). What is the best way to do accomplish this?