<?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: Proc Expand - MovAve - numeric precision in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Expand-MovAve-numeric-precision/m-p/195047#M48888</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thing &lt;STRONG&gt;proc expand&lt;/STRONG&gt; is geared for speed and skips the numerical precautions that are common in other procedures. You will have to follow the procedure call with a datastep to &lt;STRONG&gt;round()&lt;/STRONG&gt; or &lt;STRONG&gt;fuzz()&lt;/STRONG&gt; output values. If only for display, numerical formats will do the rounding for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2015 21:16:48 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2015-04-16T21:16:48Z</dc:date>
    <item>
      <title>Proc Expand - MovAve - numeric precision</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Expand-MovAve-numeric-precision/m-p/195044#M48885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can view variable UTIL as 0. Before this, I use UTIL=round(a/b,0.0001) to calculate UTIL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then I use proc expand as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC EXPAND data=trade_util out=trade_util1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ID misdate;&lt;/P&gt;&lt;P&gt;&amp;nbsp; BY customer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CONVERT util=util_MEAN3&amp;nbsp; / transformout=(movave 3 lag 1);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do anyone know why for moving average of 3 zeros, I get numbers like &lt;/P&gt;&lt;P&gt;-8.67362E-18&lt;/P&gt;&lt;P&gt;-3.1984E-18&lt;/P&gt;&lt;P&gt;-8.2038E-18&lt;/P&gt;&lt;P&gt;-3.79471E-18&lt;/P&gt;&lt;P&gt;-9.1073E-18&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I follow it up with code like this, but how can I avoid this extra step? It has something to do with numeric precision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work.trade_util1;&lt;/P&gt;&lt;P&gt;set work.trade_util1;&lt;/P&gt;&lt;P&gt;util_MEAN3=max(0,util_MEAN3);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 06:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Expand-MovAve-numeric-precision/m-p/195044#M48885</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2015-04-14T06:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Expand - MovAve - numeric precision</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Expand-MovAve-numeric-precision/m-p/195045#M48886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would anyone know the reason for the mov average mean to be such small numbers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 02:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Expand-MovAve-numeric-precision/m-p/195045#M48886</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2015-04-16T02:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Expand - MovAve - numeric precision</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Expand-MovAve-numeric-precision/m-p/195046#M48887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if it could work. Make &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;UTIL be a small length .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;UTIL 3 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and why not use INT() ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 13:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Expand-MovAve-numeric-precision/m-p/195046#M48887</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-04-16T13:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Expand - MovAve - numeric precision</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Expand-MovAve-numeric-precision/m-p/195047#M48888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thing &lt;STRONG&gt;proc expand&lt;/STRONG&gt; is geared for speed and skips the numerical precautions that are common in other procedures. You will have to follow the procedure call with a datastep to &lt;STRONG&gt;round()&lt;/STRONG&gt; or &lt;STRONG&gt;fuzz()&lt;/STRONG&gt; output values. If only for display, numerical formats will do the rounding for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 21:16:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Expand-MovAve-numeric-precision/m-p/195047#M48888</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-04-16T21:16:48Z</dc:date>
    </item>
  </channel>
</rss>

