Is there a way to remove only the repeating sub headings [red arrow] - (while still keeping the first heading [blue arrow])
Sample code to produce the output above
proc tabulate data=sashelp.class;
class age name;
var Weight;
table age*(name all='all name'*[style=[background=lightblue]]) all='all age', Weight;
run;
To get something like this with only a top header and no header for each subtotal.
Hi:
The best you can do with TABULATE is to move the row headers (Age/Name) up into the Box on the left side of the top of the table.
You might like the look and feel of PROC REPORT better:
Here's the code for PROC REPORT vs the BOX approach with TABULATE:
proc tabulate data=sashelp.class;
class age name;
var Weight;
table age=' '*(name=' ' all='all name'*[style=[background=lightblue]]) all='all age',
Weight / box='Age and Name';
run;
proc report data=sashelp.class
style(summary)=Header;
column age name weight;
define age / order style(column)=Header;
define name / order style(column)=Header;
define weight / sum;
break after age/summarize;
compute after age;
name='Name Tot';
line ' ';
endcomp;
run;
Cynthia
Hi:
The best you can do with TABULATE is to move the row headers (Age/Name) up into the Box on the left side of the top of the table.
You might like the look and feel of PROC REPORT better:
Here's the code for PROC REPORT vs the BOX approach with TABULATE:
proc tabulate data=sashelp.class;
class age name;
var Weight;
table age=' '*(name=' ' all='all name'*[style=[background=lightblue]]) all='all age',
Weight / box='Age and Name';
run;
proc report data=sashelp.class
style(summary)=Header;
column age name weight;
define age / order style(column)=Header;
define name / order style(column)=Header;
define weight / sum;
break after age/summarize;
compute after age;
name='Name Tot';
line ' ';
endcomp;
run;
Cynthia
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
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.