<?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 Conditional formatting in proc report for a variable that is both numerical and categorical in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388117#M19063</link>
    <description>&lt;P&gt;Is there a way to format data that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;P-Value&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;0.182&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;lt;0.001&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;0.002&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to highlight any cells that have a p-value less than 0.05 and also highlight "&amp;lt;0.001'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works below, however I would like to avoid a copy/paste of the statements below and manually type in "0.002". Is there a way to also format for anything &amp;lt;0.05?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;compute&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pvaluen2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pvaluen2 =&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;0.001"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;call&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;define&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(_col_,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'style'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'style=[background=ltgray]'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2017 12:55:36 GMT</pubDate>
    <dc:creator>nirali514</dc:creator>
    <dc:date>2017-08-15T12:55:36Z</dc:date>
    <item>
      <title>Conditional formatting in proc report for a variable that is both numerical and categorical</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388117#M19063</link>
      <description>&lt;P&gt;Is there a way to format data that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;P-Value&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;0.182&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;lt;0.001&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;0.002&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to highlight any cells that have a p-value less than 0.05 and also highlight "&amp;lt;0.001'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works below, however I would like to avoid a copy/paste of the statements below and manually type in "0.002". Is there a way to also format for anything &amp;lt;0.05?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;compute&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pvaluen2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pvaluen2 =&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;0.001"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;call&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;define&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(_col_,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'style'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'style=[background=ltgray]'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 12:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388117#M19063</guid>
      <dc:creator>nirali514</dc:creator>
      <dc:date>2017-08-15T12:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting in proc report for a variable that is both numerical and categorical</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388119#M19065</link>
      <description>&lt;P&gt;Or if the data looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;P-Value&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;0.182&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;0.00001&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;0.002&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to format highlightling for values &amp;lt;0.05 and also change 0.00001 to show "&amp;lt;0.001"&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 12:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388119#M19065</guid>
      <dc:creator>nirali514</dc:creator>
      <dc:date>2017-08-15T12:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting in proc report for a variable that is both numerical and categorical</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388222#M19067</link>
      <description>&lt;P&gt;Both of these are doable with custom formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value Pback
 low - &amp;lt;0.05= 'Red'
 ;
 value mypval
 low - &amp;lt;0.001 = '&amp;lt;0.001'
 other        = [best5.]
 ;
 run;&lt;/PRE&gt;
&lt;P&gt;In the define block where you want the value highlight use the format instead of a color&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;style=[background= pback.]&lt;/P&gt;
&lt;P&gt;if you want a different color when the the value is larger than 0.05 then add and "other" line to the pback format and the color desired.&lt;/P&gt;
&lt;P&gt;And just use format=mypval. for the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add as many color ranges as you would like but they cannot overlap. See the syntax for Proc Format on specifying ranges.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 17:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388222#M19067</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-15T17:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting in proc report for a variable that is both numerical and categorical</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388473#M19072</link>
      <description>&lt;PRE&gt;
data x;
input pValue;
format pvalue pvalue12.3;
cards;
0.182
0.00001
0.002
;
run;




compute pvaluen2;
if pvaluen2 &amp;lt;0.001 then do;
call define(_col_,'style','style=[background=ltgray]');
end;

&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Aug 2017 14:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388473#M19072</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-08-16T14:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting in proc report for a variable that is both numerical and categorical</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388633#M19079</link>
      <description>Thank you very much!! This worked&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Aug 2017 21:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Conditional-formatting-in-proc-report-for-a-variable-that-is/m-p/388633#M19079</guid>
      <dc:creator>nirali514</dc:creator>
      <dc:date>2017-08-16T21:36:01Z</dc:date>
    </item>
  </channel>
</rss>

