<?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 Highlight cell with multiple rule in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Highlight-cell-with-multiple-rule/m-p/514103#M138612</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;You have 2 issues:&lt;BR /&gt;1) not referenced B correctly. You either need to reference B.SUM in your IF statement or you need a DEFINE statement that defines B as DISPLAY usage&lt;BR /&gt;and&lt;BR /&gt;2) You cannot refer to B in the COMPUTE block for A. My guess is that the default order of variables is N, A and B. PROC REPORT has a left-to-right rule where, for example, if this is your COLUMN statement, either explicit or implicit:&lt;BR /&gt;column n a b;&lt;BR /&gt;you cannot refer to A or B in a compute block for N and you cannot refer to B in the compute block for A. PROC REPORT writes one report row at a time and writes one column at a time, working from left to right. So, at the point in time when REPORT puts N on the report row, it does not have any visibility of A or B and when REPORT puts A on the report row, there is no visibility of B yet. However, in a COMPUTE block for B you can test the values of N, A and B. You can also change N or A or B with a CALL DEFINE in the COMPUTE block for B, you just need the right syntax.&lt;/P&gt;
&lt;P&gt;Are you getting error messages in the log or warnings when you run your existing code?&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Sat, 17 Nov 2018 04:59:02 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2018-11-17T04:59:02Z</dc:date>
    <item>
      <title>proc report Highlight cell with multiple rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Highlight-cell-with-multiple-rule/m-p/514093#M138603</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;Can you please help me fix this code as to why the 2nd record is not highlighted?&lt;/P&gt;
&lt;P&gt;I want to highlight cell in column A when: A&amp;gt; 0 and B=1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much,&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input n a b;
datalines;
1 2 .
&lt;STRONG&gt;2 3 1&lt;/STRONG&gt;
3 0 1
4 -2 .
5 4 -1
;run;

proc report data=have nowd;
		define a/display;
		compute a  ;
		if a&amp;gt;0 and b=1 then call define(_col_,"style","style={background=light greenish yellow}");
		endcomp;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 04:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Highlight-cell-with-multiple-rule/m-p/514093#M138603</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-11-17T04:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc report Highlight cell with multiple rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Highlight-cell-with-multiple-rule/m-p/514102#M138611</link>
      <description>&lt;P&gt;this should work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=have nowd;
			column n a b ;
			    define n/display;
				define a/display;
				define b/display;
				
                 compute  b;
					if a&amp;gt;0  and b=1 then do;		
			    do i = 2 to 3;
				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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 04:56:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Highlight-cell-with-multiple-rule/m-p/514102#M138611</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-11-17T04:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc report Highlight cell with multiple rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Highlight-cell-with-multiple-rule/m-p/514103#M138612</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;You have 2 issues:&lt;BR /&gt;1) not referenced B correctly. You either need to reference B.SUM in your IF statement or you need a DEFINE statement that defines B as DISPLAY usage&lt;BR /&gt;and&lt;BR /&gt;2) You cannot refer to B in the COMPUTE block for A. My guess is that the default order of variables is N, A and B. PROC REPORT has a left-to-right rule where, for example, if this is your COLUMN statement, either explicit or implicit:&lt;BR /&gt;column n a b;&lt;BR /&gt;you cannot refer to A or B in a compute block for N and you cannot refer to B in the compute block for A. PROC REPORT writes one report row at a time and writes one column at a time, working from left to right. So, at the point in time when REPORT puts N on the report row, it does not have any visibility of A or B and when REPORT puts A on the report row, there is no visibility of B yet. However, in a COMPUTE block for B you can test the values of N, A and B. You can also change N or A or B with a CALL DEFINE in the COMPUTE block for B, you just need the right syntax.&lt;/P&gt;
&lt;P&gt;Are you getting error messages in the log or warnings when you run your existing code?&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 04:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Highlight-cell-with-multiple-rule/m-p/514103#M138612</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-11-17T04:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: proc report Highlight cell with multiple rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Highlight-cell-with-multiple-rule/m-p/514126#M138625</link>
      <description>&lt;P&gt;Thank you for your help.&lt;/P&gt;
&lt;P&gt;I learn a lot from the code and discussion.&lt;/P&gt;
&lt;P&gt;HHCFX&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 14:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Highlight-cell-with-multiple-rule/m-p/514126#M138625</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-11-17T14:51:47Z</dc:date>
    </item>
  </channel>
</rss>

