<?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: problem with proc format in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-with-proc-format/m-p/2274#M761</link>
    <description>This rather looks like a rounding problem, than a format problem.&lt;BR /&gt;
ROUNDing the result of your VAL3 variable to, say, 0.0001 would work just fine.&lt;BR /&gt;
&lt;BR /&gt;
val3=ROUND (Sum(0,val1)-Sum(0,val2), .0001) ;&lt;BR /&gt;
&lt;BR /&gt;
See problems and discussions about SAS rounding in the documentation :&lt;BR /&gt;
&lt;A href="http://support.sas.com/onlinedoc/913/getDoc/fr/lrcon.hlp/" target="_blank"&gt;http://support.sas.com/onlinedoc/913/getDoc/fr/lrcon.hlp/&lt;/A&gt; a000695157.htm (you have to suppress the space character in the web adress, but if I don't type it, I have .ht displayed instead of .htm).</description>
    <pubDate>Fri, 09 Feb 2007 11:57:54 GMT</pubDate>
    <dc:creator>Olivier</dc:creator>
    <dc:date>2007-02-09T11:57:54Z</dc:date>
    <item>
      <title>problem with proc format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-with-proc-format/m-p/2273#M760</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:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-with-proc-format/m-p/2273#M760</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-02-09T09:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: problem with proc format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-with-proc-format/m-p/2274#M761</link>
      <description>This rather looks like a rounding problem, than a format problem.&lt;BR /&gt;
ROUNDing the result of your VAL3 variable to, say, 0.0001 would work just fine.&lt;BR /&gt;
&lt;BR /&gt;
val3=ROUND (Sum(0,val1)-Sum(0,val2), .0001) ;&lt;BR /&gt;
&lt;BR /&gt;
See problems and discussions about SAS rounding in the documentation :&lt;BR /&gt;
&lt;A href="http://support.sas.com/onlinedoc/913/getDoc/fr/lrcon.hlp/" target="_blank"&gt;http://support.sas.com/onlinedoc/913/getDoc/fr/lrcon.hlp/&lt;/A&gt; a000695157.htm (you have to suppress the space character in the web adress, but if I don't type it, I have .ht displayed instead of .htm).</description>
      <pubDate>Fri, 09 Feb 2007 11:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/problem-with-proc-format/m-p/2274#M761</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2007-02-09T11:57:54Z</dc:date>
    </item>
  </channel>
</rss>

