<?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-conditional color of entire rows based on value in 2 columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-color-of-entire-rows-based-on-value-in-2/m-p/498972#M132709</link>
    <description>&lt;P&gt;You have to change "order" to "display" and use variable "Sex" to get the desired output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.class;
   column name age sex height weight;
   define name / display;
   define age / display;
   define sex / display;
   define height / sum;
   define weight / sum;

   compute Sex;
      if Age &amp;lt;= 12 AND Sex = 'M' then do;
         call define(_row_,"style","style={background=blue}");
      end;
      else do;
         if 12 &amp;lt; Age AND Sex='F' then do;
            call define(_row_,"style","style={background=red}");
         end;
      end;
   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Sep 2018 07:23:24 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2018-09-26T07:23:24Z</dc:date>
    <item>
      <title>proc report-conditional color of entire rows based on value in 2 columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-color-of-entire-rows-based-on-value-in-2/m-p/498966#M132706</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am using proc report.&lt;/P&gt;
&lt;P&gt;I want to color entire rows based on values in 2 columns.&lt;/P&gt;
&lt;P&gt;I understand that &amp;nbsp;"compute age Sex" is wrong but what is the way to solve it?&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=sashelp.class nowd;
     column name age sex height weight;
     define name / display;
     define age / display;
     define sex / order;
     define height / sum;
     define weight / sum;

compute age Sex;
     if age  &amp;lt;= 12 AND Sex='M' then
        call define(_row_,"style","style={background=blue}");

     else if 12&amp;lt; AND Sex='F' then
          call define(_row_,"style","style={background=red}");

   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>Wed, 26 Sep 2018 06:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-color-of-entire-rows-based-on-value-in-2/m-p/498966#M132706</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-09-26T06:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc report-conditional color of entire rows based on value in 2 columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-color-of-entire-rows-based-on-value-in-2/m-p/498972#M132709</link>
      <description>&lt;P&gt;You have to change "order" to "display" and use variable "Sex" to get the desired output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.class;
   column name age sex height weight;
   define name / display;
   define age / display;
   define sex / display;
   define height / sum;
   define weight / sum;

   compute Sex;
      if Age &amp;lt;= 12 AND Sex = 'M' then do;
         call define(_row_,"style","style={background=blue}");
      end;
      else do;
         if 12 &amp;lt; Age AND Sex='F' then do;
            call define(_row_,"style","style={background=red}");
         end;
      end;
   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Sep 2018 07:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-color-of-entire-rows-based-on-value-in-2/m-p/498972#M132709</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-09-26T07:23:24Z</dc:date>
    </item>
  </channel>
</rss>

