<?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: issue with proc format in Developers</title>
    <link>https://communities.sas.com/t5/Developers/issue-with-proc-format/m-p/2267#M1627</link>
    <description>Due to the ( lack of ) precision in floating point operations on the computer , the value val3 is nor excactly -600 in both cases.&lt;BR /&gt;
&lt;BR /&gt;
insert &lt;BR /&gt;
valx=val3+600;&lt;BR /&gt;
put valx= 20.15;&lt;BR /&gt;
&lt;BR /&gt;
in each data step and you will  see  &lt;BR /&gt;
&lt;BR /&gt;
valx=0.000000000000000 &lt;BR /&gt;
and&lt;BR /&gt;
valx=0.000000000000114&lt;BR /&gt;
and since the format is separated on either side of -600 , the results differ.&lt;BR /&gt;
At least on mi Intel based computer.</description>
    <pubDate>Tue, 24 Apr 2007 22:37:40 GMT</pubDate>
    <dc:creator>hdo</dc:creator>
    <dc:date>2007-04-24T22:37:40Z</dc:date>
    <item>
      <title>issue with proc format</title>
      <link>https://communities.sas.com/t5/Developers/issue-with-proc-format/m-p/2265#M1625</link>
      <description>Hi &lt;BR /&gt;
I am trying to run below sas code and its giving me unexpected result.Can I have help on this. &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
In both case1 and case2 val3 is assigned -600 but the value of val4 derived from the format is differing.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc format;&lt;BR /&gt;
Value   u33mbchg&lt;BR /&gt;
&lt;BR /&gt;
                low     -       -600    =       '   94.7649     '&lt;BR /&gt;
&lt;BR /&gt;
                -600   &amp;lt;-       -200    =       '   95.8705     '&lt;BR /&gt;
&lt;BR /&gt;
                -200   &amp;lt;-       -100    =       '   99.4335     '&lt;BR /&gt;
&lt;BR /&gt;
                -100   &amp;lt;-       high    =       '  100.9247     '     ;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
case1: &lt;BR /&gt;
&lt;BR /&gt;
Data T1;&lt;BR /&gt;
&lt;BR /&gt;
val1=sum(440.0001,0.01);&lt;BR /&gt;
&lt;BR /&gt;
val2=sum(1040.0001,0.01);&lt;BR /&gt;
&lt;BR /&gt;
val3=Sum(0,val1)-Sum(0,val2);&lt;BR /&gt;
&lt;BR /&gt;
val4 = 1*put(val3,u33mbchg.);&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
output&lt;BR /&gt;
val1=440.0101&lt;BR /&gt;
val2=1040.0101&lt;BR /&gt;
val3=-600&lt;BR /&gt;
val4=94.7649&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
 &lt;BR /&gt;
 &lt;BR /&gt;
Using the above proc format we ran the same code with different input value in val1 and val2 as below:&lt;BR /&gt;
 &lt;BR /&gt;
case2:&lt;BR /&gt;
Data T1;&lt;BR /&gt;
&lt;BR /&gt;
val1=sum(440.1,0.01);&lt;BR /&gt;
&lt;BR /&gt;
val2=sum(1040.1,0.01);&lt;BR /&gt;
&lt;BR /&gt;
val3=Sum(0,val1)-Sum(0,val2);&lt;BR /&gt;
&lt;BR /&gt;
val4 = 1*put(val3,u33mbchg.);&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
output:&lt;BR /&gt;
val1=440.11&lt;BR /&gt;
val2=1040.11&lt;BR /&gt;
val3=-600&lt;BR /&gt;
val4=95.8705</description>
      <pubDate>Fri, 09 Feb 2007 09:34:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/issue-with-proc-format/m-p/2265#M1625</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-02-09T09:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: issue with proc format</title>
      <link>https://communities.sas.com/t5/Developers/issue-with-proc-format/m-p/2266#M1626</link>
      <description>What value do you expect to be the correct one for val4?</description>
      <pubDate>Fri, 09 Feb 2007 14:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/issue-with-proc-format/m-p/2266#M1626</guid>
      <dc:creator>Diane_SAS</dc:creator>
      <dc:date>2007-02-09T14:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: issue with proc format</title>
      <link>https://communities.sas.com/t5/Developers/issue-with-proc-format/m-p/2267#M1627</link>
      <description>Due to the ( lack of ) precision in floating point operations on the computer , the value val3 is nor excactly -600 in both cases.&lt;BR /&gt;
&lt;BR /&gt;
insert &lt;BR /&gt;
valx=val3+600;&lt;BR /&gt;
put valx= 20.15;&lt;BR /&gt;
&lt;BR /&gt;
in each data step and you will  see  &lt;BR /&gt;
&lt;BR /&gt;
valx=0.000000000000000 &lt;BR /&gt;
and&lt;BR /&gt;
valx=0.000000000000114&lt;BR /&gt;
and since the format is separated on either side of -600 , the results differ.&lt;BR /&gt;
At least on mi Intel based computer.</description>
      <pubDate>Tue, 24 Apr 2007 22:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/issue-with-proc-format/m-p/2267#M1627</guid>
      <dc:creator>hdo</dc:creator>
      <dc:date>2007-04-24T22:37:40Z</dc:date>
    </item>
  </channel>
</rss>

