BookmarkSubscribeRSS Feed
HannaZhang
Obsidian | Level 7

 

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

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? 

HannaZhang
Obsidian | Level 7

WeChat Image_20190821151206.png

I don't know if the following picture can help you understand the report structure

ChrisNZ
Tourmaline | Level 20

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  

 

HannaZhang
Obsidian | Level 7
Thanks,It helps a lot!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1216 views
  • 0 likes
  • 2 in conversation