<?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: Conditional Formatting using Proc Report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763459#M241792</link>
    <description>&lt;P&gt;hi andreas_Ids&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dataset looks like below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YNWA1_1-1629794075423.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62912i9F5041A2D03B4992/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YNWA1_1-1629794075423.png" alt="YNWA1_1-1629794075423.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to achieve the below report&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YNWA1_0-1629793464648.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62910i5CC66041C838D485/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YNWA1_0-1629793464648.png" alt="YNWA1_0-1629793464648.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;My code:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;proc report data=TEST nowd;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;columns exception business_date,Num_Excpt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;define exception/group "Total Number Each Month Exception Type";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;define business_date/across order=data "Month";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;define Num_Excpt/"";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get the structure of the report with correct data, however i am struggling to apply the background colour. I tried using proc format but i can't apply it on the&amp;nbsp;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;Num_Excpt field. I derived a new field to get the difference between current and previous month and my proc format is based on that calculated field.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an easy way to achieve this using PROC and ODS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Aug 2021 08:47:11 GMT</pubDate>
    <dc:creator>YNWA1</dc:creator>
    <dc:date>2021-08-24T08:47:11Z</dc:date>
    <item>
      <title>Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763427#M241782</link>
      <description>&lt;P&gt;Hi, I need some help....&lt;/P&gt;&lt;P&gt;I want to use PROC REPORT in SAS to generate a report - Example attached&lt;/P&gt;&lt;P&gt;Report is a count of Exception by Types across Months (6 months)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If current month count &amp;gt; previous month count then apply background color to RED&lt;/P&gt;&lt;P&gt;If current month count&amp;lt; previous month count then apply background color to GREEN&lt;/P&gt;&lt;P&gt;If current month count= previous month count then apply background color to YELLOW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to produce the report however the tricky part is how to apply the formatting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for helping&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 07:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763427#M241782</guid>
      <dc:creator>YNWA1</dc:creator>
      <dc:date>2021-08-24T07:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763428#M241783</link>
      <description>&lt;P&gt;Welcome in the SAS community!&lt;/P&gt;
&lt;P&gt;I won't open any office files, so i don't see the data you have.&lt;/P&gt;
&lt;P&gt;You should post the code you have already written, please use "insert sas code" and don't attach it.&lt;/P&gt;
&lt;P&gt;I am not sure, that comparing with previous values is possible in proc report.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 07:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763428#M241783</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-08-24T07:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763451#M241786</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do a google search for "proc report traffic lighting", you'll find lots of resources dealing with conditional coloring of values in PROC REPORT and ODS.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 08:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763451#M241786</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-24T08:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763459#M241792</link>
      <description>&lt;P&gt;hi andreas_Ids&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dataset looks like below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YNWA1_1-1629794075423.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62912i9F5041A2D03B4992/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YNWA1_1-1629794075423.png" alt="YNWA1_1-1629794075423.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to achieve the below report&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YNWA1_0-1629793464648.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62910i5CC66041C838D485/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YNWA1_0-1629793464648.png" alt="YNWA1_0-1629793464648.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;My code:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;proc report data=TEST nowd;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;columns exception business_date,Num_Excpt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;define exception/group "Total Number Each Month Exception Type";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;define business_date/across order=data "Month";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;define Num_Excpt/"";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get the structure of the report with correct data, however i am struggling to apply the background colour. I tried using proc format but i can't apply it on the&amp;nbsp;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;Num_Excpt field. I derived a new field to get the difference between current and previous month and my proc format is based on that calculated field.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an easy way to achieve this using PROC and ODS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 08:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763459#M241792</guid>
      <dc:creator>YNWA1</dc:creator>
      <dc:date>2021-08-24T08:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763464#M241796</link>
      <description>&lt;P&gt;Pictures are even worse than Excel files.&lt;/P&gt;
&lt;P&gt;Please supply your data in a data step with datalines like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines dlm=",";
input num_excpt business_date :date9. exception_type :$10.;
format business_date date9.;
datalines;
312,31aug2020,Type A
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This allows everybody to quickly recreate your dataset with a simple copy/paste and submit, without any doubts about data types, attributes and content.&lt;/P&gt;
&lt;P&gt;Use this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;to post logs or other fixed-format text, and the "little running man" right next to it for SAS code.&lt;/P&gt;
&lt;P&gt;This is meant when we say "code box".&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 09:17:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763464#M241796</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-24T09:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763478#M241806</link>
      <description>&lt;P&gt;Thanx KurtBremser for your response...I am still getting use to the portal&lt;/P&gt;&lt;P&gt;I have inserted the datastep now&lt;/P&gt;&lt;PRE&gt;data TEST;
infile datalines dlm=",";
input num_excpt business_date :date9. exception_type :$10.;
format business_date date9.;
datalines;
312,31aug2020,Type A
283,30Sep2020,Type A
253,31Oct2020,Type A
270,30Nov2020,Type A
292,31Dec2020,Type A
292,31Jan2021,Type A
296,31Aug2020,Type B
310,30Sep2020,Type B
313,31Oct2020,Type B
299,30Nov2020,Type B
327,31Dec2020,Type B
303,31Jan2021,Type B
545,31Aug2020,Type C
553,30Sep2020,Type C
590,31Oct2020,Type C
550,30Nov2020,Type C
589,31Dec2020,Type C
617,31Jan2021,Type C
1697,31Aug2020,Type D
1784,30Sep2020,Type D
1813,31Oct2020,Type D
1864,30Nov2020,Type D
1905,31Dec2020,Type D
1953,31Jan2021,Type D

;
run;

proc report data=TEST nowd;
columns exception_type (business_date),Num_Excpt;
define exception_type/group "Total Number Each Month Exception Type";
define business_date/across order=data "Month";
define Num_Excpt/"";
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Aug 2021 11:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763478#M241806</guid>
      <dc:creator>YNWA1</dc:creator>
      <dc:date>2021-08-24T11:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763479#M241807</link>
      <description>&lt;P&gt;Thank you for providing the data in the desired form!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you still need to take the suggestion above from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;and do a search for "proc report traffic lighting" and you will find example code for your PROC REPORT.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 11:40:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763479#M241807</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-24T11:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763494#M241816</link>
      <description>&lt;P&gt;It is show time for data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data TEST;
infile datalines dlm=",";
input num_excpt business_date :date9. exception_type :$10.;
format business_date date9.;
datalines;
312,31aug2020,Type A
283,30Sep2020,Type A
253,31Oct2020,Type A
270,30Nov2020,Type A
292,31Dec2020,Type A
292,31Jan2021,Type A
296,31Aug2020,Type B
310,30Sep2020,Type B
313,31Oct2020,Type B
299,30Nov2020,Type B
327,31Dec2020,Type B
303,31Jan2021,Type B
545,31Aug2020,Type C
553,30Sep2020,Type C
590,31Oct2020,Type C
550,30Nov2020,Type C
589,31Dec2020,Type C
617,31Jan2021,Type C
1697,31Aug2020,Type D
1784,30Sep2020,Type D
1813,31Oct2020,Type D
1864,30Nov2020,Type D
1905,31Dec2020,Type D
1953,31Jan2021,Type D
;
run;

proc sort data=test; by exception_type business_date ;run;
data test2;
 set test;
 by exception_type;
 length char_except $  200;
 char_except=put(num_excpt,best32. -l);
 if not first.exception_type and dif(num_excpt)&amp;gt;0 then char_except=cats('(*ESC*)S={background=red }',char_except);
 if not first.exception_type and dif(num_excpt)=0 then char_except=cats('(*ESC*)S={background=yellow}',char_except);
 if not first.exception_type and dif(num_excpt)&amp;lt;0 then char_except=cats('(*ESC*)S={background=green}',char_except);

run;


options orientation=landscape;
ods rtf file="c:\temp\temp.rtf" style=journal bodytitle;
proc report data=TEST2 nowd;
columns ("Total Number Each Month Exception Type" exception_type) ("Month" business_date),char_Except;
define exception_type/group ' ' style={cellwidth=30%};
define business_date/across order=data ' ' format=monyy7.;
define char_Except/group "";
run;
ods rtf close;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1629809377835.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62915i21D8781EBA6DF1E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1629809377835.png" alt="Ksharp_0-1629809377835.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 12:49:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763494#M241816</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-08-24T12:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763768#M241883</link>
      <description>Hi Ksharp&lt;BR /&gt;Thanks a lot for providing a solution. I have one question though..what if i want to compute a grand total at the end of the report. I can't use the char_Except as it is of char type.</description>
      <pubDate>Wed, 25 Aug 2021 00:54:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763768#M241883</guid>
      <dc:creator>YNWA1</dc:creator>
      <dc:date>2021-08-25T00:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763818#M241908</link>
      <description>&lt;P&gt;OK.Try this one .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data TEST;
infile datalines dlm=",";
input num_excpt business_date :date9. exception_type :$10.;
format business_date date9.;
datalines;
312,31aug2020,Type A
283,30Sep2020,Type A
253,31Oct2020,Type A
270,30Nov2020,Type A
292,31Dec2020,Type A
292,31Jan2021,Type A
296,31Aug2020,Type B
310,30Sep2020,Type B
313,31Oct2020,Type B
299,30Nov2020,Type B
327,31Dec2020,Type B
303,31Jan2021,Type B
545,31Aug2020,Type C
553,30Sep2020,Type C
590,31Oct2020,Type C
550,30Nov2020,Type C
589,31Dec2020,Type C
617,31Jan2021,Type C
1697,31Aug2020,Type D
1784,30Sep2020,Type D
1813,31Oct2020,Type D
1864,30Nov2020,Type D
1905,31Dec2020,Type D
1953,31Jan2021,Type D
;
run;




proc sql noprint;
select count(distinct put(business_date,monyy7.))+1 into :n
 from test;
quit;
data _null_;
length month $ 200;
 do i=2 to &amp;amp;n;
   month=catx(' ',month,cats('_C',i,'_'));
 end;
call symputx('month',month);
run;


proc report data=TEST nowd;
columns ("Total Number Each Month Exception Type" exception_type) ("Month" business_date),num_excpt;
define exception_type/group ' ' ;
define business_date/across order=data ' ' format=monyy7.;
define num_excpt/analysis sum "";
compute num_excpt;
 array x{*} &amp;amp;month ;
do i=2 to dim(x);
if x{i-1}&amp;lt;x{i} then call define(vname(x{i}),'style','style={background=red}');
if x{i-1}=x{i} then call define(vname(x{i}),'style','style={background=yellow}');
if x{i-1}&amp;gt;x{i} then call define(vname(x{i}),'style','style={background=green}');
 end;
endcomp;
compute after;
exception_type='GrandTotal';
endcomp;
rbreak after /summarize;
run;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1629891996658.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62976iA3883E5FC786CA4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1629891996658.png" alt="Ksharp_0-1629891996658.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 11:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763818#M241908</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-08-25T11:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763831#M241913</link>
      <description>Thanks KSharp. Is there an easy way to suppress formatting in the last row i.e Grand Total</description>
      <pubDate>Wed, 25 Aug 2021 13:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763831#M241913</guid>
      <dc:creator>YNWA1</dc:creator>
      <dc:date>2021-08-25T13:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763893#M241934</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;
proc report data=TEST nowd;
   columns ("Total Number Each Month Exception Type" exception_type) ("Month" business_date),num_excpt;
   define exception_type/group ' ' ;
   define business_date/across order=data ' ' format=monyy7.;
   define num_excpt/analysis sum "";
   compute num_excpt;
      array x{*} &amp;amp;month ;
      do i=2 to dim(x);
         if x{i-1}&amp;lt;x{i} then call define(vname(x{i}),'style','style={background=red}');
         if x{i-1}=x{i} then call define(vname(x{i}),'style','style={background=yellow}');
         if x{i-1}&amp;gt;x{i} then call define(vname(x{i}),'style','style={background=green}');
      end;
   endcomp;
   compute after ;
      exception_type='GrandTotal';
      do i=2 to dim(x);
         if x{i-1}&amp;lt;x{i} then call define(vname(x{i}),'style','style={background=white}');
         if x{i-1}=x{i} then call define(vname(x{i}),'style','style={background=white}');
         if x{i-1}&amp;gt;x{i} then call define(vname(x{i}),'style','style={background=white}');
      end;

   endcomp;
   rbreak after /summarize style={background=white};
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Aug 2021 16:31:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/763893#M241934</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-25T16:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/764153#M242021</link>
      <description>&lt;P&gt;Sure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc report data=TEST nowd;
columns ("Total Number Each Month Exception Type" exception_type) ("Month" business_date),num_excpt;
define exception_type/group ' ' ;
define business_date/across order=data ' ' format=monyy7.;
define num_excpt/analysis sum "";
compute num_excpt;
 array x{*} &amp;amp;month ;
if missing(_break_) then do;
do i=2 to dim(x);
if x{i-1}&amp;lt;x{i} then call define(vname(x{i}),'style','style={background=red}');
if x{i-1}=x{i} then call define(vname(x{i}),'style','style={background=yellow}');
if x{i-1}&amp;gt;x{i} then call define(vname(x{i}),'style','style={background=green}');
 end;
end;
endcomp;
compute after;
exception_type='GrandTotal';
endcomp;
rbreak after /summarize;
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-1629977747673.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63047i35EB280897042446/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1629977747673.png" alt="Ksharp_0-1629977747673.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 11:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Formatting-using-Proc-Report/m-p/764153#M242021</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-08-26T11:36:06Z</dc:date>
    </item>
  </channel>
</rss>

