<?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: Traffic Lighting Cells in Proc Report in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115673#M31978</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; As Tim recommends, defining WEIGHT would allow you to do the comparisons easier. I am confused about one thing though. Does the variable MAXWEIGHT exist on every observation in the dataset or are you computing MAXWEIGHT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Just curious. If MAXWEIGHT already exists in your data, you might have to change your code slightly from what Tim shows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, we do offer a report class that covers ODS, PROC TABULATE and PROC REPORT.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;id=284#outline" title="https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;id=284#outline"&gt;https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;id=284#outline&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jul 2012 15:27:03 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2012-07-23T15:27:03Z</dc:date>
    <item>
      <title>Traffic Lighting Cells in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115671#M31976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, this should be easy - or so I thought. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to compare 2 cells, and highlight one of them if it is larger then the second.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I want to highlight the weight if it is higher then the max weight. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="151" style="border: 1px solid #000000; width: 404px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Product&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Weight&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;MaxWeight&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;7&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have as code, that does not work -&amp;nbsp; I'm not sure how to use the compute block to create a different style: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=work.data nowd;&lt;/P&gt;&lt;P&gt;column product weight maxweight;&lt;/P&gt;&lt;P&gt;define weight / computed ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; compute weight;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if weight &amp;lt; maxweight then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight','style','style={background=White}');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if weight&amp;gt; maxweight then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight','style','style={background=yellow}');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I need to take a class on Proc Report. Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2012 14:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115671#M31976</guid>
      <dc:creator>Kimberley</dc:creator>
      <dc:date>2012-07-23T14:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic Lighting Cells in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115672#M31977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this. By default numeric variables such as "weight" are analysis variables and so have statistics associated with them. In a compute block you would refer to the statistic. For example "weight.sum".&amp;nbsp; In this case, however, you don't want statistics, you just want to display the value, so you should specify "weight" as a display variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc report data=sashelp.class nowd;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;column name weight;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;define name--weight / display;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;compute before;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; maxweight = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;endcomp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;compute weight;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if weight &amp;lt; maxweight then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight','style','style={background=green}');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if weight &amp;gt; maxweight then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight','style','style={background=yellow}');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxweight = weight;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;endcomp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2012 15:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115672#M31977</guid>
      <dc:creator>Tim_SAS</dc:creator>
      <dc:date>2012-07-23T15:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic Lighting Cells in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115673#M31978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; As Tim recommends, defining WEIGHT would allow you to do the comparisons easier. I am confused about one thing though. Does the variable MAXWEIGHT exist on every observation in the dataset or are you computing MAXWEIGHT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Just curious. If MAXWEIGHT already exists in your data, you might have to change your code slightly from what Tim shows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, we do offer a report class that covers ODS, PROC TABULATE and PROC REPORT.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;id=284#outline" title="https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;id=284#outline"&gt;https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;id=284#outline&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2012 15:27:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115673#M31978</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-07-23T15:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic Lighting Cells in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115674#M31979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cynthia,&amp;nbsp; maxweight does already exist in my dataset, maybe that's why I can't seem to make Tim's code work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How woudl I need to change the code? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help, I will look into taking the class, thanks for the info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2012 16:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115674#M31979</guid>
      <dc:creator>Kimberley</dc:creator>
      <dc:date>2012-07-23T16:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic Lighting Cells in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115675#M31980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; SASHELP.CLASS did not have a variable called MAXWEIGHT, so Tim's code creates that variable as a "temp" variable. If you are going to do a comparison between WEIGHT and MAXWEIGHT, then you will need your COMPUTE block to be for MAXWEIGHT. PROC REPORT places variables on the report from LEFT to RIGHT. So, if this is your COLUMN statement:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;column product weight maxweight;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then, at the point in time when WEIGHT is being placed on the report row, PROC REPORT has not yet placed MAXWEIGHT on the report row. So if you did your test in the COMPUTE block for WEIGHT, I suspect that every row would be yellow because MAXWEIGHT does not have a value yet. If MAXWEIGHT exists in the data, then the proper place for you to do your test is in a COMPUTE block for MAXWEIGHT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The code below shows 3 different methods:&lt;/P&gt;&lt;P&gt;1) Method 1: has DISPLAY usage for WEIGHT and MAXWEIGHT&lt;/P&gt;&lt;P&gt;2) Method 2: has SUM usage for WEIGHT and MAXWEIGHT (notice how this changes the reference method in the COMPUTE block and CALL DEFINE statement&lt;/P&gt;&lt;P&gt;3) Method 3: has MEAN usage for WEIGHT and MAXWEIGHT (because I wanted to show how the summary line for Averages could be created with an RBREAK statement)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I changed the logical operators to be LE and GT (which I prefer over &amp;lt;, &amp;gt; or &amp;lt;= or &amp;gt;=), so that the equal situation (if WEIGHT=MAXWEIGHT) would be covered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data fakedata;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; length product $10;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; infile datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; input product $ weight maxweight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;return;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;A 4 5&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;A 6 5&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;B 3 4&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;3 4 3&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;C 7 3&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods _all_ close;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title; footnote;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html file='c:\temp\hilight.html';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=work.fakedata nowd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title 'Method 1: All items are DISPLAY usage';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;column product weight maxweight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define product / display;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define weight / display ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define maxweight / display;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ** use LE to take care of equal situation instead of just LT;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; compute maxweight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if weight le maxweight then do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight','style','style={background=White}');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if weight gt maxweight then do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight','style','style={background=yellow}');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt; proc report data=work.fakedata nowd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title 'Method 2: All numeric items are SUM usage (default)';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;column product weight maxweight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define product / display;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define weight / sum ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define maxweight / sum;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; compute maxweight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if weight.sum le maxweight.sum then do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight.sum','style','style={background=White}');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if weight.sum gt maxweight.sum then do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight.sum','style','style={background=yellow}');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt; proc report data=work.fakedata nowd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title 'Method 3: Numeric items are MEAN usage with summary line at bottom';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; column product weight maxweight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define product / display;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define weight / mean ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define maxweight / mean;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; rbreak after / summarize;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; compute after;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; product='Averages';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; compute maxweight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if weight.mean le maxweight.mean then do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight.mean','style','style={background=White}');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if weight.mean gt maxweight.mean then do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('Weight.mean','style','style={background=yellow}');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt; run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2012 17:53:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115675#M31980</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-07-23T17:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic Lighting Cells in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115676#M31981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As an aside notice in Cynthia's code that the compute block is for MAXWEIGHT and not WEIGHT.&amp;nbsp; In the original posted code you are attempting to use the variable MAXWEIGHT in the WEIGHT compute block.&amp;nbsp; Since MAXWEIGHT is to the right of WEIGHT in the COLUMN statement, MAXWEIGHT cannot yet be addressed.&amp;nbsp; Remember that for a compute block associated with a given report item you may only address report items to the left of it in the COLUMN statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2012 18:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115676#M31981</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2012-07-23T18:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic Lighting Cells in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115677#M31982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you everyone for your help, I understand a lot more about how the compute block works now, and how to traffic light better. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cynthia, you were absolutely right - the whole column did turn yellow.&amp;nbsp; I'm looking into taking the class, I wish it was available on e-learning, so much easier to convince my manager to take e-learning classes then having to travel to the US (I'm in Canada). The web class would be great, but the schedule is so disruptive to our daily operations, but is still probably our best option. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2012 11:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-Cells-in-Proc-Report/m-p/115677#M31982</guid>
      <dc:creator>Kimberley</dc:creator>
      <dc:date>2012-07-26T11:59:57Z</dc:date>
    </item>
  </channel>
</rss>

