<?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: Simple way to color whole column and color cell with single rule in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Simple-way-to-color-whole-column-Row-and-color-cell-with-single/m-p/514136#M138628</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input n a b;
datalines;
1 2 .
2 3 1
3 0 1
4 -2 .
5 4 -1
;run;
proc report data=have nowd;
column n a b ;
    define n/display;
	define a/display;
	define b/display;
	
    compute  b;	/*if you need to check a condition, COMPUTE the last column to the right*/
		if a&amp;gt;0  and b=1 then do;		
    do i = 2 to 3;	/*column to color*/
	call define(i, "style","style={background=light greenish yellow}");
	end;
	end;				
	endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Nov 2018 16:22:48 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2018-11-17T16:22:48Z</dc:date>
    <item>
      <title>Simple way to color whole column/Row and color cell with single rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-way-to-color-whole-column-Row-and-color-cell-with-single/m-p/514089#M138600</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc report data=sashelp.class nowd;
*Color whole column;
	compute age;
	call define(_col_,"style","style={background=gray}");
	endcomp;&lt;BR /&gt;

*color rule 1;
	define Height/display;
	compute Height;
	if Height&amp;lt;60 then call define(_col_,"style","style={background=red}");
	endcomp;

*color rule 2;
	define Weight/display;
	compute Weight;
	if Weight&amp;lt;100 then call define(_col_,"style","style={background=Yellow}");
	endcomp;
run;&lt;BR /&gt;&lt;BR /&gt;*Color the whole row;&lt;BR /&gt;proc report data=sashelp.class nowd ;&lt;BR /&gt; define Age/display;&lt;BR /&gt;compute Age;&lt;BR /&gt; if Age &amp;gt; 15 then call define(_row_,"style","style={background=Red}");&lt;BR /&gt; endcomp;&lt;BR /&gt;run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jan 2019 03:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-way-to-color-whole-column-Row-and-color-cell-with-single/m-p/514089#M138600</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-01-16T03:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to color whole column and color cell with single rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-way-to-color-whole-column-Row-and-color-cell-with-single/m-p/514090#M138601</link>
      <description>&lt;P&gt;here also&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;</description>
      <pubDate>Sat, 17 Nov 2018 02:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-way-to-color-whole-column-Row-and-color-cell-with-single/m-p/514090#M138601</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-11-17T02:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to color whole column and color cell with single rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-way-to-color-whole-column-Row-and-color-cell-with-single/m-p/514136#M138628</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input n a b;
datalines;
1 2 .
2 3 1
3 0 1
4 -2 .
5 4 -1
;run;
proc report data=have nowd;
column n a b ;
    define n/display;
	define a/display;
	define b/display;
	
    compute  b;	/*if you need to check a condition, COMPUTE the last column to the right*/
		if a&amp;gt;0  and b=1 then do;		
    do i = 2 to 3;	/*column to color*/
	call define(i, "style","style={background=light greenish yellow}");
	end;
	end;				
	endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 16:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-way-to-color-whole-column-Row-and-color-cell-with-single/m-p/514136#M138628</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-11-17T16:22:48Z</dc:date>
    </item>
  </channel>
</rss>

