<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding Summaries, Hiding Column Values in PROC REPORT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-Summaries-Hiding-Column-Values-in-PROC-REPORT/m-p/677869#M204538</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I simulated your question with the SASHELP.CARS dataset, and think I found a solution to your second question:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS _ALL_ close;
ODS listing;

PROC REPORT DATA=SASHELP.CARS LS=93  PS=80  SPLIT="/" CENTER ;
COLUMN  Origin DriveTrain EngineSize Cylinders MPG_Highway;

DEFINE  Origin / GROUP FORMAT= $8. WIDTH=10    SPACING=2   LEFT "Origin" ;
DEFINE  DriveTrain / GROUP FORMAT= $5. WIDTH=10    SPACING=2   LEFT "DriveTrain" ;
DEFINE  EngineSize / SUM FORMAT= BEST9. WIDTH=9     SPACING=2   RIGHT "Engine Size (L)" ;
DEFINE  Cylinders / SUM FORMAT= BEST9. WIDTH=9     SPACING=2   RIGHT "Cylinders" ;
DEFINE  MPG_Highway / SUM FORMAT= BEST9. WIDTH=9     SPACING=2   RIGHT "MPG (Highway)" ;

BREAK BEFORE Origin / SUMMARIZE ;

RBREAK BEFORE  / SUMMARIZE ;

compute drivetrain ;
    	if _break_ = 'Origin' then drivetrain = 'Total';
		if _break_ = '_RBREAK_' then drivetrain = 'Total';
	endcomp;

compute origin;
	if _break_ = '_RBREAK_' then origin = 'Overall';
	else if _break_ ne 'Origin' then origin = " ";
endcomp;
RUN;

ODS _ALL_ close;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Aug 2020 17:02:35 GMT</pubDate>
    <dc:creator>MCoopmans</dc:creator>
    <dc:date>2020-08-19T17:02:35Z</dc:date>
    <item>
      <title>Adding Summaries, Hiding Column Values in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-Summaries-Hiding-Column-Values-in-PROC-REPORT/m-p/676402#M203946</link>
      <description>&lt;P&gt;I am making a somewhat complicated summary table in PROC REPORT where I want to summarize within each group variable and summarize the group variables themselves. Here is a picture of what I have (with flags included):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="plot.png" style="width: 895px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48187i752DE7C0E35BB1FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="plot.png" alt="plot.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There are two things I want to accomplish:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;I want to provide overall summaries for 'Competition' and 'Practice' event types at the top, under the 'Overall Total' summary&lt;/LI&gt;
&lt;LI&gt;I want to suppress the sport names that are being duplicated&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Is this possible? I'd love to do it through PROC REPORT without having to just brute force a new dataset to make it work. Below is my current code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=all_t1 nowd split="*"
		style(report)=[frame=hsides rules=none]
		style(header)=[background=white color=&amp;amp;rgreen. borderbottomcolor=black]
		style(lines)=[background=white];
	column sport event_type unweightedinj ae ratio weightedinj flag;
	define sport / group '' format=$sport_cap.;
	define event_type / group 'Event Type' center order=formatted style(column)=[cellwidth=1in just=l];
	define unweightedinj / analysis '# Injuries' format=comma8.0 style(column)=[cellwidth=1in just=c];
	define ae / analysis '# Exposures' format=comma8.0 style(column)=[cellwidth=1in just=c];
	define ratio / computed 'Injury Rate *(per 1,000 AEs)' format=8.2 style(column)=[cellwidth=1.75in just=c];
	compute ratio;
		ratio = unweightedinj.sum/ae.sum*1000;
	endcomp;
	define weightedinj / analysis 'Nationally Estimated *# Injuries' format=comma8.0 style(column)=[cellwidth=1.75in just=c];
	define flag / computed format=$25.;  

	break before sport /summarize style(summary)={font_weight=bold};
	rbreak before /summarize style(summary)={font_weight=bold};
	compute sport;
		if _break_ = '_RBREAK_' then sport = 'Overall';
	endcomp;
	compute event_type;
    	if _break_ = 'sport' then event_type = 'Total';
		if _break_ = '_RBREAK_' then event_type = 'Total';
	endcomp;
	compute flag / CHAR;                   
      flag=_BREAK_;                          
   	endcomp;  
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Aug 2020 06:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-Summaries-Hiding-Column-Values-in-PROC-REPORT/m-p/676402#M203946</guid>
      <dc:creator>tburus</dc:creator>
      <dc:date>2020-08-13T06:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Summaries, Hiding Column Values in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-Summaries-Hiding-Column-Values-in-PROC-REPORT/m-p/677869#M204538</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I simulated your question with the SASHELP.CARS dataset, and think I found a solution to your second question:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS _ALL_ close;
ODS listing;

PROC REPORT DATA=SASHELP.CARS LS=93  PS=80  SPLIT="/" CENTER ;
COLUMN  Origin DriveTrain EngineSize Cylinders MPG_Highway;

DEFINE  Origin / GROUP FORMAT= $8. WIDTH=10    SPACING=2   LEFT "Origin" ;
DEFINE  DriveTrain / GROUP FORMAT= $5. WIDTH=10    SPACING=2   LEFT "DriveTrain" ;
DEFINE  EngineSize / SUM FORMAT= BEST9. WIDTH=9     SPACING=2   RIGHT "Engine Size (L)" ;
DEFINE  Cylinders / SUM FORMAT= BEST9. WIDTH=9     SPACING=2   RIGHT "Cylinders" ;
DEFINE  MPG_Highway / SUM FORMAT= BEST9. WIDTH=9     SPACING=2   RIGHT "MPG (Highway)" ;

BREAK BEFORE Origin / SUMMARIZE ;

RBREAK BEFORE  / SUMMARIZE ;

compute drivetrain ;
    	if _break_ = 'Origin' then drivetrain = 'Total';
		if _break_ = '_RBREAK_' then drivetrain = 'Total';
	endcomp;

compute origin;
	if _break_ = '_RBREAK_' then origin = 'Overall';
	else if _break_ ne 'Origin' then origin = " ";
endcomp;
RUN;

ODS _ALL_ close;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Aug 2020 17:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-Summaries-Hiding-Column-Values-in-PROC-REPORT/m-p/677869#M204538</guid>
      <dc:creator>MCoopmans</dc:creator>
      <dc:date>2020-08-19T17:02:35Z</dc:date>
    </item>
  </channel>
</rss>

