<?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: PROC REPORT with BY Statement in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637609#M23918</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; This type of output is possible in Excel using the ODS EXCEL destination, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1586026506543.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37926iA22C583C97E7F813/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1586026506543.png" alt="Cynthia_sas_0-1586026506543.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;(only showing 2 of the sheets for age 13 and age 14)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In order to accomplish this, several features needed to be turned on:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1586026549181.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37927i3D4BF027AE970C3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1586026549181.png" alt="Cynthia_sas_1-1586026549181.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Using the BY statement enabled the use of #byval1 for the sheet names and also enabled a separate sheet to start for every BY group value. Note how, with embedded_titles='yes', the value of the title, including the #byval1 value appears on each sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although you can't use #byval1 as a column header value, if you also have the BY variable (in this case, AGE) as an ORDER variable on the report, you can do a COMPUTE BEFORE _PAGE_ block in order to write a header line that spans the whole table for that age. Note how the TITLE string is sitting outside of the table boundaries, but the COMPUTE block LINE output is styled as a header row above the table, but inside the table boundaries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps explain how you could get close to what you want.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Sat, 04 Apr 2020 19:00:33 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2020-04-04T19:00:33Z</dc:date>
    <item>
      <title>PROC REPORT with BY Statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637132#M23915</link>
      <description>&lt;P&gt;I'm using a BY statement in PROC REPORT and report is correctly exported to excel with separate work sheet for each group in the BY variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I like to display the corresponding group variable value as a Column Label in each work sheet. Can you suggest a solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=ABC&lt;/P&gt;&lt;P&gt;BY&amp;nbsp; GRP_VARIABLE;&lt;/P&gt;&lt;P&gt;COLUMN C1 C2&amp;nbsp;&lt;/P&gt;&lt;P&gt;define C1 / center display 'First Column';&lt;BR /&gt;define C2 / center display '&amp;lt;Group Variable Value&amp;gt;';&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I' m trying get the group variable value and display that as column label or as part of the title on each work sheet. Please advice. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 02:21:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637132#M23915</guid>
      <dc:creator>DLROW</dc:creator>
      <dc:date>2020-04-03T02:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT with BY Statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637162#M23916</link>
      <description>&lt;P&gt;I don't think that changing the label of a variable is possible during runtime at all. In a title-statement, you could use #byvar (as documented in &lt;A href="https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p10gcmrmf83iaxn1ilrx4pra969n.htm&amp;amp;docsetVersion=1.0&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p10gcmrmf83iaxn1ilrx4pra969n.htm&amp;amp;docsetVersion=1.0&amp;amp;locale=en&lt;/A&gt;) to display the value of the by-variable, unfortunately this doesn't work within define-statement. Maybe this could be achieved by using a compute-block.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 05:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637162#M23916</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-04-03T05:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT with BY Statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637208#M23917</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/125795"&gt;@DLROW&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm using a BY statement in PROC REPORT and report is correctly exported to excel with separate work sheet for each group in the BY variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I like to display the corresponding group variable value as a Column Label in each work sheet. Can you suggest a solution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc report data=ABC&lt;/P&gt;
&lt;P&gt;BY&amp;nbsp; GRP_VARIABLE;&lt;/P&gt;
&lt;P&gt;COLUMN C1 C2&amp;nbsp;&lt;/P&gt;
&lt;P&gt;define C1 / center display 'First Column';&lt;BR /&gt;define C2 / center display '&amp;lt;Group Variable Value&amp;gt;';&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I' m trying get the group variable value and display that as column label or as part of the title on each work sheet. Please advice. Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Instead of BY grp_variable, add grp_variable to the COLUMN statement and the define it as a GROUP variable. Using a COMPUTE AFTER statement, you can send the output to a new page/new worksheet in Excel.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 11:38:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637208#M23917</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-03T11:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT with BY Statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637609#M23918</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; This type of output is possible in Excel using the ODS EXCEL destination, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1586026506543.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37926iA22C583C97E7F813/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1586026506543.png" alt="Cynthia_sas_0-1586026506543.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;(only showing 2 of the sheets for age 13 and age 14)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In order to accomplish this, several features needed to be turned on:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1586026549181.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37927i3D4BF027AE970C3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1586026549181.png" alt="Cynthia_sas_1-1586026549181.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Using the BY statement enabled the use of #byval1 for the sheet names and also enabled a separate sheet to start for every BY group value. Note how, with embedded_titles='yes', the value of the title, including the #byval1 value appears on each sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although you can't use #byval1 as a column header value, if you also have the BY variable (in this case, AGE) as an ORDER variable on the report, you can do a COMPUTE BEFORE _PAGE_ block in order to write a header line that spans the whole table for that age. Note how the TITLE string is sitting outside of the table boundaries, but the COMPUTE block LINE output is styled as a header row above the table, but inside the table boundaries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps explain how you could get close to what you want.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2020 19:00:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637609#M23918</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-04-04T19:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT with BY Statement</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637859#M23921</link>
      <description>&lt;P&gt;Thank you all. I was able to get the 'BY variable' in the title.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 14:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-with-BY-Statement/m-p/637859#M23921</guid>
      <dc:creator>DLROW</dc:creator>
      <dc:date>2020-04-06T14:51:18Z</dc:date>
    </item>
  </channel>
</rss>

