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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 768 views
  • 3 likes
  • 2 in conversation