We can't quite make out the structure from the screenshot and the code, which seem to only be vaguely related. but this looks like a job for proc tabulate. What is the report structure you want?
I don't know if the following picture can help you understand the report structure
I can't be bothered to try and guess what you need if you can't be bothered to explain and show usage examples.
I suggest you study this and modify as needed:
data HAVE;
retain SOC PRO COL_T A_TR B_TR C_TR COL_R A_RT B_RT C_RT COL A_TOT B_TOT C_TOT 'A';
output; output;
run;
proc tabulate missing;
class SOC PRO COL_T A_TR B_TR C_TR COL_R A_RT B_RT C_RT COL A_TOT B_TOT C_TOT ;
table PRO*n=' ',COL_T * ( A_TR B_TR C_TR )
COL_R * ( A_RT B_RT C_RT )
COL * ( A_TOT B_TOT C_TOT ) ;
run;
| COL_T | COL_R | COL | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| A | A | A | |||||||||
| A_TR | B_TR | C_TR | A_RT | B_RT | C_RT | A_TOT | B_TOT | C_TOT | |||
| A | A | A | A | A | A | A | A | A | |||
| SOC | PRO | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | |
| A | A | ||||||||||
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.