<?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; custom column headers for additional columns within the across in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592154#M23339</link>
    <description>&lt;P&gt;I want to change the column headings from 'Change' to specific type of change.&amp;nbsp; Ex.&amp;nbsp;&amp;nbsp; _c4_ column heading = 'Change in Weeks',&lt;/P&gt;&lt;P&gt;_c10_ column heading = '% Change'.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2019 13:44:23 GMT</pubDate>
    <dc:creator>datadoneright</dc:creator>
    <dc:date>2019-09-27T13:44:23Z</dc:date>
    <item>
      <title>Proc Report; custom column headers for additional columns within the across</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592119#M23337</link>
      <description>&lt;P&gt;I'm creating a report where I calculate changes between months based on the first across variable.&amp;nbsp; I have managed to insert the columns within the across and calculate the changes.&amp;nbsp; Now I want to title each type of change correctly.&amp;nbsp; The report will ultimately end up in Excel.&amp;nbsp;I'm&amp;nbsp;programming within&amp;nbsp;SAS EG 7.15, (SAS BASE 9.4).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Currrent Report Top, Desired Report Bottom" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32763iC23173EB3BB015C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="report (2).png" alt="Currrent Report Top, Desired Report Bottom" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Currrent Report Top, Desired Report Bottom&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc format;
value ex_column
	'31jul2019'd='Jul2019'
	'31aug2019'd='Aug2019'
	'15sep2019'd='Change' 
	;
Run;

Proc Report data=work.report_data_incomplete1 
(where=((crs_site = 'F') and datekey in ('31jul2019'd, '31aug2019'd) and RTTPart='Part_2')) 
out=work.proc_report1;

Title1 "TOTAL";
COLUMN ProvOrgName Label,Datekey,(Stats1);
define provorgnAME / ' ' group;
/*define sort_order /noprint across format=sort_order. preloadfmt order=data '';*/
define label / '' across order=data ;
define datekey / across nozero format=ex_column. preloadfmt '' order=data ;
define stats1 /'' ;

compute stats1;
_c4_=_c3_-_c2_;
_c7_=_c6_-_c5_;
_c10_=(_c9_-_c8_)/_c8_;
_c13_=_c12_-_c11_;
_c16_=_c15_-_c14_;
_c19_=_c18_-_c17_;
call define ('_c2_','format','4.1');
call define ('_c3_','format','4.1');
call define ('_c4_','format','4.1');
call define ('_c5_','format','4.1');
call define ('_c6_','format','4.1');
call define ('_c7_','format','4.1');
call define ('_c8_','format','bestd8.');
call define ('_c9_','format','bestd8.');
call define ('_c10_','format','percentn6.1');
call define ('_c11_','format','8.');
call define ('_c12_','format','8.');
call define ('_c13_','format','8.');
call define ('_c14_','format','8.');
call define ('_c15_','format','8.');
call define ('_c16_','format','8.');
call define ('_c17_','format','percentn6.1');
call define ('_c18_','format','percentn6.1');
call define ('_c19_','format','percentn6.1');
endcomp;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 10:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592119#M23337</guid>
      <dc:creator>datadoneright</dc:creator>
      <dc:date>2019-09-27T10:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report; custom column headers for additional columns within the across</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592151#M23338</link>
      <description>Can you detail what is your problem? Is it creating multiple lines in line 11 of the excel spreadsheet?&lt;BR /&gt;&lt;BR /&gt;Have you read: &lt;A href="http://support.sas.com/resources/papers/proceedings17/SAS0710-2017.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings17/SAS0710-2017.pdf&lt;/A&gt; and/or &lt;A href="https://communities.sas.com/t5/SAS-Procedures/Multiple-lines-in-a-PROC-REPORT-cell/td-p/312811" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/Multiple-lines-in-a-PROC-REPORT-cell/td-p/312811&lt;/A&gt;</description>
      <pubDate>Fri, 27 Sep 2019 13:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592151#M23338</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2019-09-27T13:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report; custom column headers for additional columns within the across</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592154#M23339</link>
      <description>&lt;P&gt;I want to change the column headings from 'Change' to specific type of change.&amp;nbsp; Ex.&amp;nbsp;&amp;nbsp; _c4_ column heading = 'Change in Weeks',&lt;/P&gt;&lt;P&gt;_c10_ column heading = '% Change'.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 13:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592154#M23339</guid>
      <dc:creator>datadoneright</dc:creator>
      <dc:date>2019-09-27T13:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report; custom column headers for additional columns within the across</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592194#M23341</link>
      <description>&lt;P&gt;You should either provide some example data for your problem OR recast the problem to use one of the SAS supplied data set like SASHELP.Shoes or SASHELP.Class.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 15:21:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592194#M23341</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-27T15:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report; custom column headers for additional columns within the across</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592285#M23345</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;It looks like the header value "Change" is coming from the format you've created for the DATEKEY variable. You can't change the header variable as you envision with PROC REPORT. The COMPUTE block for a variable can only touch the data cells, not the header cells.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You might be able to "fake" out the headers by making a separate fake DATEKEY value for every LABEL group, something like this -- I used SASHELP.PRDSALE Quarter=1 observations -- that gave me 3 months for each year to have across -- but I needed some "extra" observations, like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="need_extra_obs.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32786i7329CBBD271B0F2B/image-size/large?v=v2&amp;amp;px=999" role="button" title="need_extra_obs.png" alt="need_extra_obs.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I know the dates in SASHELP.PRDSALE are always 01 of each month. So that means I can my fake observation for 31dec for each year and then assign the Header that I want to each years "fake" date. This allows me to use the format, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="results.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32787iAD23AEE6E9FD9D66/image-size/large?v=v2&amp;amp;px=999" role="button" title="results.png" alt="results.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did not bother, in my PROC REPORT code to change formats or perform any calculations. You seem to have that part of the COMPUTE block working as you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But whether my approach will work for you depends on the structure of your data and how you built the DATEKEY variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 19:29:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-custom-column-headers-for-additional-columns-within/m-p/592285#M23345</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-09-27T19:29:26Z</dc:date>
    </item>
  </channel>
</rss>

