BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ywon111
Quartz | Level 8

Trying to create a table like this:

 

RegionGenderNumber
Af2
 m2
Bf2
 m2
Cf2
 m2
Totalf6
 m6

 

Have tried this, but not getting the total by gender (last two rows in the table)


proc report data=final style(summary)=header;

column region gender n;
define region/group style (column)=Header;
define gender/group;
define n / 'Total';
break after region / summarize ;

rbreak after/summarize;


run;

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

Hi:

  PROC REPORT will not give you a total line like you want without manipulating the data in advance or perhaps using a more advanced COMPUTE block. But PROC TABULATE will easily do what you want:

Cynthia_sas_0-1587850547738.png

 

Hope this helps,

 

Cynthia

View solution in original post

1 REPLY 1
Cynthia_sas
Diamond | Level 26

Hi:

  PROC REPORT will not give you a total line like you want without manipulating the data in advance or perhaps using a more advanced COMPUTE block. But PROC TABULATE will easily do what you want:

Cynthia_sas_0-1587850547738.png

 

Hope this helps,

 

Cynthia

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 1 reply
  • 684 views
  • 3 likes
  • 2 in conversation