<?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: Add Color to ODS/Proc Report in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Color-to-ODS-Proc-Report/m-p/64298#M7507</link>
    <description>Hi:&lt;BR /&gt;
  PROC REPORT builds a report row from left to right, one report item at a time. PROC REPORT does -not- have a PDV, like the Data Step. &lt;BR /&gt;
 &lt;BR /&gt;
  So that seems like it's not a big difference. Your logic might work in a DATA step program. But when PROC REPORT is placing UAID on the report row, it has not placed anything else on the report row, so at that point in time, the COMPUTE block for UAID has NO visibility of the value for FLAG.SUM and since the COMPUTE block for UAID executes when the item is placed on the report row, you will never see any highlighting.&lt;BR /&gt;
 &lt;BR /&gt;
The program below illustrates the correct way (#2) to get the row highlighted.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
 [pre] &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\showrow.html' style=sasweb;&lt;BR /&gt;
               &lt;BR /&gt;
proc report data=sashelp.class nowd;&lt;BR /&gt;
  title '1) will not work';&lt;BR /&gt;
  column name height weight age;&lt;BR /&gt;
  compute name;&lt;BR /&gt;
    if age.sum = 14 then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=red}');&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
                           &lt;BR /&gt;
proc report data=sashelp.class nowd;&lt;BR /&gt;
  title '2) will work';&lt;BR /&gt;
  column name sex height weight age;&lt;BR /&gt;
  define sex / display noprint;&lt;BR /&gt;
  compute age;&lt;BR /&gt;
    if age.sum = 14 and name = 'Henry' then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=red}');&lt;BR /&gt;
    else if age.sum=14 then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=yellow}');&lt;BR /&gt;
    else if age.sum=12 and sex='F' then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=pink}');&lt;BR /&gt;
    else if age.sum=12 and sex='M' then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=lightblue}');&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Thu, 13 Aug 2009 15:44:15 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2009-08-13T15:44:15Z</dc:date>
    <item>
      <title>Add Color to ODS/Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Color-to-ODS-Proc-Report/m-p/64297#M7506</link>
      <description>Hello&lt;BR /&gt;
&lt;BR /&gt;
I am trying to add color to a field that I have flagged, the code below doesn't seem to work. Any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods results=off;&lt;BR /&gt;
ods html file="C:\DMYM\XLS\Disaster.xls"	style=SASWeb;&lt;BR /&gt;
&lt;BR /&gt;
proc report data=dmym.natcalc nowd headline headskip center split='*' formchar(2)='_' missing;&lt;BR /&gt;
 column UAID Trans_date TRANS_ENTER_TM city AUX_ACCT_STATUS mkt_seg brand2 state flag;&lt;BR /&gt;
 define flag / analysis noprint;&lt;BR /&gt;
 compute UAID;&lt;BR /&gt;
	if FLAG.sum eq 1 then call define(_row_,"style","style={background=red}");&lt;BR /&gt;
 endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods _all_ close; ods listing;</description>
      <pubDate>Thu, 13 Aug 2009 14:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Color-to-ODS-Proc-Report/m-p/64297#M7506</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-08-13T14:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Add Color to ODS/Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Color-to-ODS-Proc-Report/m-p/64298#M7507</link>
      <description>Hi:&lt;BR /&gt;
  PROC REPORT builds a report row from left to right, one report item at a time. PROC REPORT does -not- have a PDV, like the Data Step. &lt;BR /&gt;
 &lt;BR /&gt;
  So that seems like it's not a big difference. Your logic might work in a DATA step program. But when PROC REPORT is placing UAID on the report row, it has not placed anything else on the report row, so at that point in time, the COMPUTE block for UAID has NO visibility of the value for FLAG.SUM and since the COMPUTE block for UAID executes when the item is placed on the report row, you will never see any highlighting.&lt;BR /&gt;
 &lt;BR /&gt;
The program below illustrates the correct way (#2) to get the row highlighted.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
 [pre] &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\showrow.html' style=sasweb;&lt;BR /&gt;
               &lt;BR /&gt;
proc report data=sashelp.class nowd;&lt;BR /&gt;
  title '1) will not work';&lt;BR /&gt;
  column name height weight age;&lt;BR /&gt;
  compute name;&lt;BR /&gt;
    if age.sum = 14 then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=red}');&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
                           &lt;BR /&gt;
proc report data=sashelp.class nowd;&lt;BR /&gt;
  title '2) will work';&lt;BR /&gt;
  column name sex height weight age;&lt;BR /&gt;
  define sex / display noprint;&lt;BR /&gt;
  compute age;&lt;BR /&gt;
    if age.sum = 14 and name = 'Henry' then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=red}');&lt;BR /&gt;
    else if age.sum=14 then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=yellow}');&lt;BR /&gt;
    else if age.sum=12 and sex='F' then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=pink}');&lt;BR /&gt;
    else if age.sum=12 and sex='M' then&lt;BR /&gt;
       call define(_ROW_,'STYLE','style={background=lightblue}');&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 13 Aug 2009 15:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Color-to-ODS-Proc-Report/m-p/64298#M7507</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-08-13T15:44:15Z</dc:date>
    </item>
  </channel>
</rss>

