Trying to create a table like this:
Region | Gender | Number |
A | f | 2 |
m | 2 | |
B | f | 2 |
m | 2 | |
C | f | 2 |
m | 2 | |
Total | f | 6 |
m | 6 |
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
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:
Hope this helps,
Cynthia
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:
Hope this helps,
Cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.