I am looking to transform this table type into the second one type.. (this is just to visualize, so i havent written all the age groups in the second table type)
Do you need a dataset used by other bits of a program, which has some technical issues with your variable names, or a report that people read?
One report might look like:
proc report data=have; columns decile agegroup,(rev1 rev2); define decile /group; define agegroup/across; run;
I won't say it is impossible to put the rev1 and rev2 at the bottom but that would generally be a poor idea in something that has a lot of rows
please try transpose
proc sort data=have;
by decile age_group;
run;
proc transpose data=have out=want;
by decile ;
id age_group;
var rev1;
run;
Do you need a dataset used by other bits of a program, which has some technical issues with your variable names, or a report that people read?
One report might look like:
proc report data=have; columns decile agegroup,(rev1 rev2); define decile /group; define agegroup/across; run;
I won't say it is impossible to put the rev1 and rev2 at the bottom but that would generally be a poor idea in something that has a lot of rows
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.