Hi all,
I am new to proc report and am having trouble finding an answer to the below. I am in enterprise v8.5.
I have output that looks like this:
I want to add two types of "total" summary rows - one for sub locations and one for parent location. When I do so, it looks like this:
I would like to remove the labels in red, as those rows are the totals for the sub location rather than the parent location, and ideally keep all cells for the parent location merged together until the final "Total Parent 1" row, so that it looks like this:
Is this possible? My code is below.
proc report data=disc spanrows headline headskip split="|";
define ParentLocation / order center;
define SubLocation / order center;
define DataPtA / display "Data|Pt A";
define DataPtB / display "Data|Pt B";
column ("Location" ParentLocation SubLocation)
DataPtA DataPtB;
break after ParentLocation / summarize;
compute after ParentLocation;
ParentLocation="Total " || ParentLocation;
call define (_row_,'style', 'style=[font_style=bold]');
endcomp;
break after SubLocation / summarize;
compute after SubLocation;
SubLocation="Total " || SubLocation;
call define (_row_,'style', 'style=[font_style=italic]');
endcomp;
run;
Thank you!
This method puts text on reports where there is none, but the same thing ought to work for removing text that you don't want.
This method puts text on reports where there is none, but the same thing ought to work for removing text that you don't want.
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.