<?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 Proc Report - style conditionally in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/979800#M26948</link>
    <description>&lt;P&gt;Just trying to learn proc report, and i dont know how to style my cell conditionally..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ways to color my cell (background=yellow) when MSRP / Invoice &amp;gt; 100k AND,&lt;/P&gt;
&lt;P&gt;change font color (color=red) when&amp;nbsp;MSRP / Invoice &amp;gt; 1 Mil ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Appreciate your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Sample:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisWoo_0-1764610411584.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111682i78735D15A09A708A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChrisWoo_0-1764610411584.png" alt="ChrisWoo_0-1764610411584.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;&lt;U&gt;&lt;STRONG&gt;Here my code:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.cars list spanrows;
	title "This is a complete report";
	columns ("World Vehicle" origin make) drivetrain ,(msrp invoice);
	format msrp invoice dollar18.2;
	
	define Origin / group center;
	define Make / group left;
	define DriveTrain / across left;

	break after origin / summarize style=[fontweight=bold];
	
    compute MSRP;
       if MSRP &amp;gt; 100000  then
       call define(_col_, "style", "style={backgroundcolor=yellow}");
    endcomp;
	
    compute after origin;
        line " ";
    endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Dec 2025 17:39:54 GMT</pubDate>
    <dc:creator>ChrisWoo</dc:creator>
    <dc:date>2025-12-01T17:39:54Z</dc:date>
    <item>
      <title>Proc Report - style conditionally</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/979800#M26948</link>
      <description>&lt;P&gt;Just trying to learn proc report, and i dont know how to style my cell conditionally..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ways to color my cell (background=yellow) when MSRP / Invoice &amp;gt; 100k AND,&lt;/P&gt;
&lt;P&gt;change font color (color=red) when&amp;nbsp;MSRP / Invoice &amp;gt; 1 Mil ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Appreciate your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Sample:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisWoo_0-1764610411584.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111682i78735D15A09A708A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChrisWoo_0-1764610411584.png" alt="ChrisWoo_0-1764610411584.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;&lt;U&gt;&lt;STRONG&gt;Here my code:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.cars list spanrows;
	title "This is a complete report";
	columns ("World Vehicle" origin make) drivetrain ,(msrp invoice);
	format msrp invoice dollar18.2;
	
	define Origin / group center;
	define Make / group left;
	define DriveTrain / across left;

	break after origin / summarize style=[fontweight=bold];
	
    compute MSRP;
       if MSRP &amp;gt; 100000  then
       call define(_col_, "style", "style={backgroundcolor=yellow}");
    endcomp;
	
    compute after origin;
        line " ";
    endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 17:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/979800#M26948</guid>
      <dc:creator>ChrisWoo</dc:creator>
      <dc:date>2025-12-01T17:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - style conditionally</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/979802#M26949</link>
      <description>&lt;P&gt;When you refer to variables under an Across, you need to refer to them by the column position, _Cn_. You can simplify this by using macro logic. Try the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro loop;
ods listing close;
ods excel file='c:\temp\test.xlsx';

proc report data=sashelp.cars list spanrows;
	title "This is a complete report";
	columns ("World Vehicle" origin make) drivetrain ,(msrp invoice) dummy;
	format msrp invoice dollar18.2;
	
	define Origin / group center;
	define Make / group left;
	define DriveTrain / across left;
	define dummy / computed noprint;

	break after origin / summarize style=[fontweight=bold];
	
    compute dummy;
	 %do i=3 %to 8;
       if _c&amp;amp;i._ &amp;gt; 100000  then
       call define("_c&amp;amp;i._", "style", "style={backgroundcolor=yellow}");
       if _c&amp;amp;i._ &amp;gt; 1000000  then
       call define("_c&amp;amp;i._", "style/merge", "style={foreground=red}");
	 %end;
    endcomp;
	
    compute after origin;
        line " ";
    endcomp;
run;

ods excel close;
ods listing;
title;
%mend;
%loop&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Dec 2025 18:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/979802#M26949</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-12-01T18:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - style conditionally</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/979837#M26950</link>
      <description>&lt;P&gt;The most convenient way is using Traffic Light trick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value background
100000&amp;lt;-high='yellow' 
;

value foreground
100000&amp;lt;-high='red' 
;
run;


proc report data=sashelp.cars list spanrows nowd;
	title "This is a complete report";
	columns ("World Vehicle" origin make) drivetrain ,(msrp invoice);
	format msrp invoice dollar18.2;
	define Origin / group center;
	define Make / group left;
	define DriveTrain / across left;
	define msrp/analysis sum style={background=background. foreground=foreground.};
	define invoice/analysis sum style={background=background. foreground=foreground.};

	break after origin / summarize style=[fontweight=bold];
		
    compute after origin;
        line " ";
    endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1764660812693.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111698i876C6F3F794C54E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1764660812693.png" alt="Ksharp_0-1764660812693.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2025 07:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/979837#M26950</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-12-02T07:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - style conditionally</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/979975#M26951</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/442441"&gt;@ChrisWoo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Any ways to color my cell (background=yellow) when MSRP / Invoice &amp;gt; 100k AND,&lt;/P&gt;
&lt;P&gt;change font color (color=red) when&amp;nbsp;MSRP / Invoice &amp;gt; 1 Mil ?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Did anyone else reading this ask themselves what is to be highlighted because of that division calculation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ChrisWoo, for questions related to programming you may want to use words like "or" or "and" as appropriate instead of symbols like / * + - that may be interpreted as arithmetic operators.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2025 22:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/979975#M26951</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-12-03T22:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - style conditionally</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/980186#M26952</link>
      <description>I will keep it in mind, thanks</description>
      <pubDate>Fri, 05 Dec 2025 05:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-style-conditionally/m-p/980186#M26952</guid>
      <dc:creator>ChrisWoo</dc:creator>
      <dc:date>2025-12-05T05:08:51Z</dc:date>
    </item>
  </channel>
</rss>

