<?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 Customizing a PROC REPORT table in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customizing-a-PROC-REPORT-table/m-p/412163#M19836</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a table using PROC REPORT that looks like this (reproduced in Excel with fake numbers):&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="image.png" style="width: 574px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16557i7FCFC21796986A9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
options printerpath=png nodate nonumber papersize=('9.0in','8.0in') leftmargin=0.5in rightmargin=0.5in bottommargin=0.65in;
ods _all_ close  ;
ods printer file="c:/user/homareau/SAS_SQL/QBR/ip_gainers_decliners.png" style=sasweb ;
proc report data=gain_decl  nowd spanrows center;
column ('FY18Q1 IP Gainers &amp;amp; Decliners by ADV' impact customer NAICS_bucket naics_desc YoYChg Contribution);
define Impact / "Impact" group style=[FONTWEIGHT=BOLD];
define customer / "Customer Name" display;
define naics_bucket / "Customer's / Industry Code" display;
define YoYChg / "ADV YoY" display sum format=NEGPAREN12.0 ;
define naics_desc / "Description of / Customer's Industry" display ;
*define contribution / "Contribution /to YoY" display; 
break after impact / dol skip summarize suppress style=[font_size=10];
Compute after impact;
Line "";
endcomp;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;ods printer close;&lt;BR /&gt;ods listing;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;No problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to color code the 'ADV YoY' column so that negative values are red, positive are green.&amp;nbsp; However the figures are coming out red in this column, regardless of my compute statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
options printerpath=png nodate nonumber papersize=('9.0in','8.0in') leftmargin=0.5in rightmargin=0.5in bottommargin=0.65in;
ods _all_ close  ;
ods printer file="c:/user/homareau/SAS_SQL/QBR/ip_gainers_decliners.png" style=sasweb ;
proc report data=gain_decl  nowd spanrows center;
column ('FY18Q1 IP Gainers &amp;amp; Decliners by ADV' impact customer NAICS_bucket naics_desc YoYChg Contribution);
define Impact / "Impact" group style=[FONTWEIGHT=BOLD];
define customer / "Customer Name" display;
define naics_bucket / "Customer's / Industry Code" display;
define YoYChg / "ADV YoY" display sum format=NEGPAREN12.0 ;
define naics_desc / "Description of / Customer's Industry" display ;
*define contribution / "Contribution /to YoY" display; 
break after impact / dol skip summarize suppress style=[font_size=10];
Compute after impact;
Line "";
endcomp;
* Turns negative YOY values to red;
compute YoYChg;
if sign(YoYChg) &amp;lt; 0 then call define(_col_,'style','style=[color=RED]' );
if sign(YoYChg) &amp;gt; 0 then call define(_col_,'style','style=[color=GREEN]');
endcomp;

run;
ods printer close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is what I end up with:&amp;nbsp;&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="image.png" style="width: 574px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16556i27802122BF77DAD1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Three Questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. How do I fix my code so in the 'ADV YoY' column to show&amp;nbsp;&lt;FONT color="#339966"&gt;gainers are&lt;STRONG&gt; green&lt;/STRONG&gt; and &lt;FONT color="#FF0000"&gt;decliners are &lt;STRONG&gt;red&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;2.&amp;nbsp;Can I adjust the size of my title font 'FY18Q1 IP Gainers &amp;amp; Decliners by ADV' to be larger than it is?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;3. In the&amp;nbsp; rows with the totals there are 4 empty cells.&amp;nbsp; Can I merge them and put text that says something like 'Total&amp;nbsp; of Gainers' and 'Total of Decliners' for each of the categories?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Jack&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Nov 2017 21:53:49 GMT</pubDate>
    <dc:creator>Jack1</dc:creator>
    <dc:date>2017-11-09T21:53:49Z</dc:date>
    <item>
      <title>Customizing a PROC REPORT table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customizing-a-PROC-REPORT-table/m-p/412163#M19836</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a table using PROC REPORT that looks like this (reproduced in Excel with fake numbers):&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="image.png" style="width: 574px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16557i7FCFC21796986A9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
options printerpath=png nodate nonumber papersize=('9.0in','8.0in') leftmargin=0.5in rightmargin=0.5in bottommargin=0.65in;
ods _all_ close  ;
ods printer file="c:/user/homareau/SAS_SQL/QBR/ip_gainers_decliners.png" style=sasweb ;
proc report data=gain_decl  nowd spanrows center;
column ('FY18Q1 IP Gainers &amp;amp; Decliners by ADV' impact customer NAICS_bucket naics_desc YoYChg Contribution);
define Impact / "Impact" group style=[FONTWEIGHT=BOLD];
define customer / "Customer Name" display;
define naics_bucket / "Customer's / Industry Code" display;
define YoYChg / "ADV YoY" display sum format=NEGPAREN12.0 ;
define naics_desc / "Description of / Customer's Industry" display ;
*define contribution / "Contribution /to YoY" display; 
break after impact / dol skip summarize suppress style=[font_size=10];
Compute after impact;
Line "";
endcomp;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;ods printer close;&lt;BR /&gt;ods listing;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;No problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to color code the 'ADV YoY' column so that negative values are red, positive are green.&amp;nbsp; However the figures are coming out red in this column, regardless of my compute statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
options printerpath=png nodate nonumber papersize=('9.0in','8.0in') leftmargin=0.5in rightmargin=0.5in bottommargin=0.65in;
ods _all_ close  ;
ods printer file="c:/user/homareau/SAS_SQL/QBR/ip_gainers_decliners.png" style=sasweb ;
proc report data=gain_decl  nowd spanrows center;
column ('FY18Q1 IP Gainers &amp;amp; Decliners by ADV' impact customer NAICS_bucket naics_desc YoYChg Contribution);
define Impact / "Impact" group style=[FONTWEIGHT=BOLD];
define customer / "Customer Name" display;
define naics_bucket / "Customer's / Industry Code" display;
define YoYChg / "ADV YoY" display sum format=NEGPAREN12.0 ;
define naics_desc / "Description of / Customer's Industry" display ;
*define contribution / "Contribution /to YoY" display; 
break after impact / dol skip summarize suppress style=[font_size=10];
Compute after impact;
Line "";
endcomp;
* Turns negative YOY values to red;
compute YoYChg;
if sign(YoYChg) &amp;lt; 0 then call define(_col_,'style','style=[color=RED]' );
if sign(YoYChg) &amp;gt; 0 then call define(_col_,'style','style=[color=GREEN]');
endcomp;

run;
ods printer close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is what I end up with:&amp;nbsp;&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="image.png" style="width: 574px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16556i27802122BF77DAD1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Three Questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. How do I fix my code so in the 'ADV YoY' column to show&amp;nbsp;&lt;FONT color="#339966"&gt;gainers are&lt;STRONG&gt; green&lt;/STRONG&gt; and &lt;FONT color="#FF0000"&gt;decliners are &lt;STRONG&gt;red&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;2.&amp;nbsp;Can I adjust the size of my title font 'FY18Q1 IP Gainers &amp;amp; Decliners by ADV' to be larger than it is?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;3. In the&amp;nbsp; rows with the totals there are 4 empty cells.&amp;nbsp; Can I merge them and put text that says something like 'Total&amp;nbsp; of Gainers' and 'Total of Decliners' for each of the categories?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Jack&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 21:53:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customizing-a-PROC-REPORT-table/m-p/412163#M19836</guid>
      <dc:creator>Jack1</dc:creator>
      <dc:date>2017-11-09T21:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Customizing a PROC REPORT table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customizing-a-PROC-REPORT-table/m-p/412168#M19837</link>
      <description>&lt;P&gt;I don't think you want the style applied to the full column, just the cell?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 22:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customizing-a-PROC-REPORT-table/m-p/412168#M19837</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-09T22:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Customizing a PROC REPORT table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customizing-a-PROC-REPORT-table/m-p/412171#M19838</link>
      <description>&lt;P&gt;Just the cells that show a YoY drop to be red, YoY gain to be green.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 22:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customizing-a-PROC-REPORT-table/m-p/412171#M19838</guid>
      <dc:creator>Jack1</dc:creator>
      <dc:date>2017-11-09T22:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Customizing a PROC REPORT table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customizing-a-PROC-REPORT-table/m-p/412182#M19839</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;1. How do I fix my code so in the 'ADV YoY' column to show&amp;nbsp;&lt;FONT color="#339966"&gt;gainers are&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;green&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;decliners are&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;red&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;Use a custom format instead. See page 8 of here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings11/290-2011.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings11/290-2011.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp;Can I adjust the size of my title font 'FY18Q1 IP Gainers &amp;amp; Decliners by ADV' to be larger than it is?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Yes, you can&amp;nbsp;definitely make it larger.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3. In the&amp;nbsp; rows with the totals there are 4 empty cells.&amp;nbsp; Can I merge them and put text that says something like 'Total&amp;nbsp; of Gainers' and 'Total of Decliners' for each of the categories?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I don't know if that's exactly possible but you could customize those last lines for sure to have the totals shown in a single cell.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 23:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Customizing-a-PROC-REPORT-table/m-p/412182#M19839</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-09T23:53:44Z</dc:date>
    </item>
  </channel>
</rss>

