<?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: Group by Columns in PROC REPORT in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Group-by-Columns-in-PROC-REPORT/m-p/151837#M11878</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;File upload is not working at the moment.&lt;/P&gt;&lt;P&gt;In response to your question, to get headings like that they are called across headers.&amp;nbsp; So:&lt;/P&gt;&lt;P&gt;columns ('BENEFIT' FYFB12-FYFB15) ('COST' FYF12C-FYF15C);&lt;/P&gt;&lt;P&gt;This will by default provide centered headers.&amp;nbsp; You can however change either the template you are using, or put a style command in to adjust alignments.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Aug 2014 12:24:53 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-08-07T12:24:53Z</dc:date>
    <item>
      <title>Group by Columns in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Group-by-Columns-in-PROC-REPORT/m-p/151834#M11875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my data, there is a variable called "TYPE", with 3 sub-types.&amp;nbsp; I created a report using List Report Wizard in SAS EG.&amp;nbsp; However, the resultant report view has each subtype on a page.&amp;nbsp; See rows 1-41 in the attached file.&amp;nbsp; I would like it to look like the table in row 49.&amp;nbsp; I am added callouts/comments in the file regarding what calculations I need to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type = needs to be grouped by columns&lt;/P&gt;&lt;P&gt;Version, Forecast Qualiifer, InitiativeType and Program = needs to be grouped by rows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code generated by SAS, with some modifications on my part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is much appreciated! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************************************************&lt;/P&gt;&lt;P&gt;data overall_report;&lt;/P&gt;&lt;P&gt;set AAA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Version_2=Version;&lt;/P&gt;&lt;P&gt;InitiativeType_2=InitiativeType;&lt;/P&gt;&lt;P&gt;ForecastQualifier_2=ForecastQualifier;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=jen1.overall_report nowd;&lt;/P&gt;&lt;P&gt;&amp;nbsp; column Type Version ForecastQualifier InitiativeType Version_2 ForecastQualifier_2 InitiativeType_2 Program FYF14, SUM=FYF14_SUM FYF15, SUM=FYF15_SUM FYF16, SUM=FYF16_SUM FYF5Y, SUM=FYF5Y_SUM;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Type / group format=$CHAR7. missing noprint order=formatted;&lt;/P&gt;&lt;P&gt;&amp;nbsp; break after Type / page;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; compute before _page_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; text1= ''||trim(left(put(Type,$CHAR7.)));&lt;/P&gt;&lt;P&gt;&amp;nbsp; if Type=' ' then text1=' ';&lt;/P&gt;&lt;P&gt;&amp;nbsp; line text1 $;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Version / group format=$CHAR8. 'Version' missing noprint order=formatted;&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute Version;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if Version ne ' ' then hold1=Version;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if Version eq ' ' then Version=hold1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define ForecastQualifier / group format=$CHAR14. 'ForecastQualifier' missing noprint order=formatted;&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute ForecastQualifier;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ForecastQualifier ne ' ' then hold2=ForecastQualifier;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ForecastQualifier eq ' ' then ForecastQualifier=hold2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define InitiativeType / group format=$CHAR15. 'InitiativeType' missing noprint order=formatted;&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute InitiativeType;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if InitiativeType ne ' ' then hold3=InitiativeType;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if InitiativeType eq ' ' then InitiativeType=hold3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Version_2 / group 'Version' format=$CHAR8. missing order=formatted;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /***Calc the sub-totals***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute Version_2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if upcase(_break_) eq "VERSION_2" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Version_2=' ';&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if upcase(_break_) eq "VERSION_2" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Version=' ';&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if upcase(_break_)="VERSION_2" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call define("Version_2", 'style', 'style=[pretext="Subtotal&amp;nbsp; "]');&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _break_='_RBREAK_' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call define("Version_2", 'style', 'style=[pretext="Total "]');&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define ForecastQualifier_2 / group 'ForecastQualifier' format=$CHAR14. missing order=formatted;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define InitiativeType_2 / group 'InitiativeType' format=$CHAR15. missing order=formatted;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Program / group 'Program' format=$CHAR42. missing order=formatted;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define FYF14 / analysis SUM 'FYF14' format=MILLION. missing;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define FYF14_SUM / format=MILLION.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define FYF15 / analysis SUM 'FYF15' format=MILLION. missing;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define FYF15_SUM / format=MILLION.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define FYF16 / analysis SUM 'FYF16' format=MILLION. missing;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define FYF16_SUM / format=MILLION.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define FYF5Y / analysis SUM 'FYF5Y' format=MILLION. missing;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define FYF5Y_SUM / format=MILLION.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /***Add Grand Total Row***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; break before Version / summarize;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /***Add Sub-Total Rows***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; break before Version_2 / summarize;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;TITLE; FOOTNOTE;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2014 17:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Group-by-Columns-in-PROC-REPORT/m-p/151834#M11875</guid>
      <dc:creator>jen123</dc:creator>
      <dc:date>2014-08-06T17:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Group by Columns in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Group-by-Columns-in-PROC-REPORT/m-p/151835#M11876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; I can't see your picture because it is still being scanned for viruses. But your code explicitly uses PAGE processing. So have you tried taking out the PAGE on the BREAK statement?&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** from your posted code;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;break after Type / &lt;SPAN style="color: #ff00ff;"&gt;page&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; compute before &lt;SPAN style="color: #ff00ff;"&gt;_page_;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; text1= ''||trim(left(put(Type,$CHAR7.)));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; if Type=' ' then text1=' ';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; line text1 $;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 01:20:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Group-by-Columns-in-PROC-REPORT/m-p/151835#M11876</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-08-07T01:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Group by Columns in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Group-by-Columns-in-PROC-REPORT/m-p/151836#M11877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cynthia - I do not know why it takes so long for the virus scanning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had actually tried taking out the entire line:&amp;nbsp; break after Type / page; and it still didn't do what I needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a "workaround", since I am limited on time, I separated the file into datasets by type and then will attempt to use PROC Report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am stuck on this one part.&amp;nbsp; For my workaround, I created these columns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="512"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;FYF12B&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;FYF13B&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;FYF14B&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;FYF15B&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;FYF12C&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;FYF13C&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;FYF14C&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;FYF15C&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it Is possible, how do I create these column headers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="512"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" colspan="4" height="20" width="256"&gt;BENEFIT&lt;/TD&gt;&lt;TD class="xl65" colspan="4" style="border-left: none;" width="256"&gt;COST&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;FYF12&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;FYF13&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;FYF14&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;FYF15&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;FYF12&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;FYF13&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;FYF14&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;FYF15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 11:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Group-by-Columns-in-PROC-REPORT/m-p/151836#M11877</guid>
      <dc:creator>jen123</dc:creator>
      <dc:date>2014-08-07T11:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Group by Columns in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Group-by-Columns-in-PROC-REPORT/m-p/151837#M11878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;File upload is not working at the moment.&lt;/P&gt;&lt;P&gt;In response to your question, to get headings like that they are called across headers.&amp;nbsp; So:&lt;/P&gt;&lt;P&gt;columns ('BENEFIT' FYFB12-FYFB15) ('COST' FYF12C-FYF15C);&lt;/P&gt;&lt;P&gt;This will by default provide centered headers.&amp;nbsp; You can however change either the template you are using, or put a style command in to adjust alignments.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 12:24:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Group-by-Columns-in-PROC-REPORT/m-p/151837#M11878</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-08-07T12:24:53Z</dc:date>
    </item>
  </channel>
</rss>

