<?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: SAS Proc Report Decimal point highlight issue in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Proc-Report-Decimal-point-highlight-issue/m-p/423599#M27303</link>
    <description>&lt;P&gt;For the columns in AMTPREMIUM_QIS that appear to be improperly flagged, I believe that you've run into the problem with floating point variables that decimals can't be exactly represented in binary.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Demonstrate;
	AMTPREMIUM = 62.34;
	AMTPREMIUM_6970CarGlass = 62.33;

	if AMTPREMIUM - AMTPREMIUM_6970CarGlass &amp;gt; .01 then
		Flag1 = 1;
	else Flag1 = 0;

	if AMTPREMIUM - AMTPREMIUM_6970CarGlass &amp;gt; .011 then
		Flag2 = 1;
	else Flag2 = 0;
	putlog Flag1= Flag2=;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;On your AMTEXTFORPAYPERI_QIS issue, because AMTEXTFORPAYPERI is missing, the entire equation will come out to missing, and I believe that missing values are considered less than any number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Tue, 26 Dec 2017 15:45:01 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2017-12-26T15:45:01Z</dc:date>
    <item>
      <title>SAS Proc Report Decimal point highlight issue</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Proc-Report-Decimal-point-highlight-issue/m-p/423558#M27290</link>
      <description>&lt;P&gt;deleted&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 05:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Proc-Report-Decimal-point-highlight-issue/m-p/423558#M27290</guid>
      <dc:creator>srinidelite</dc:creator>
      <dc:date>2018-06-18T05:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc Report Decimal point highlight issue</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Proc-Report-Decimal-point-highlight-issue/m-p/423599#M27303</link>
      <description>&lt;P&gt;For the columns in AMTPREMIUM_QIS that appear to be improperly flagged, I believe that you've run into the problem with floating point variables that decimals can't be exactly represented in binary.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Demonstrate;
	AMTPREMIUM = 62.34;
	AMTPREMIUM_6970CarGlass = 62.33;

	if AMTPREMIUM - AMTPREMIUM_6970CarGlass &amp;gt; .01 then
		Flag1 = 1;
	else Flag1 = 0;

	if AMTPREMIUM - AMTPREMIUM_6970CarGlass &amp;gt; .011 then
		Flag2 = 1;
	else Flag2 = 0;
	putlog Flag1= Flag2=;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;On your AMTEXTFORPAYPERI_QIS issue, because AMTEXTFORPAYPERI is missing, the entire equation will come out to missing, and I believe that missing values are considered less than any number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2017 15:45:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Proc-Report-Decimal-point-highlight-issue/m-p/423599#M27303</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-12-26T15:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Proc Report Decimal point highlight issue</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Proc-Report-Decimal-point-highlight-issue/m-p/423609#M27306</link>
      <description>&lt;P&gt;You are rounding in the wrong place.&amp;nbsp; Let's convert your test data into a dataset and try to report it.&amp;nbsp; First let's show the value of the actual difference between the absolute values and then round that difference.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input Value1	Value2	ExpectedDiff ;
  copy2=value2;
  diff1=abs(value1)-abs(value2) ;
  diff2=round(diff1,0.01);
  format diff: 20.17 ;
cards;
62.21 -62.22 -0.01
65.89 -65.88 0.01
-78.3 78.39 -0.09
-89.87 89.85 0.02
. . .
;
proc print data=have ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 583px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17530iD711177EA93F7E64/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now let's try it with PROC REPORT.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=have ;
  define _all_ / display ;
compute value2 ;
  if abs(round(abs(value1)-abs(value2),0.01)) &amp;gt; 0.01 then
    call define (_col_,"style","style={background= orange}")
  ;
endcomp;
compute copy2;
if ((abs(round(value1,0.01)) - abs(round(value2,0.01)) &amp;lt; -0.01)
 or (abs(round(value1,0.01)) - abs(round(value2,0.01)) &amp;gt;0.01)) then 
  call define (_col_,"style","style={background= orange}")
;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 549px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17531i29A4E6FC3C56A5BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2017 16:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Proc-Report-Decimal-point-highlight-issue/m-p/423609#M27306</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-12-26T16:52:11Z</dc:date>
    </item>
  </channel>
</rss>

