<?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 Last decimal truncated in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Last-decimal-truncated/m-p/215629#M53062</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="kf" id=":37v" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;Dear all,&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;I am going crazy with this problem.&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;I want to generate a number starting from a date and a string like 2456701&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;I want to obtain a decimal number like xxxxxx,2456701 where xxxx is the difference between a date and a threshold&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;DIV class="aec" style="font-size: 12.8000001907349px; margin-left: 40px;"&gt;&lt;DIV class="kl" dir="ltr" id=":4ap" style="margin-bottom: 4px;"&gt;length threshold date_formatted site_factor 8.;&lt;/DIV&gt;&lt;DIV class="kl" dir="ltr" style="margin-bottom: 4px;"&gt;&lt;BR /&gt;threshold = put(input('01JAN2000:00:00:00.000', DATETIME22.3),8.);&lt;/DIV&gt;&lt;DIV class="kl" dir="ltr" style="margin-bottom: 4px;"&gt;date_formatted = put(vardate, 8.) ;&lt;BR /&gt;site_factor = date_formatted - treshold;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/DIV&gt;&lt;DIV class="kl" dir="ltr" style="margin-bottom: 4px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; site = site_factor + pno*0.0000001;&lt;/DIV&gt;&lt;DIV class="kl" dir="ltr" id=":4ap" style="margin-bottom: 4px;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P class="kq" style="margin-bottom: 0.2em; color: #777777; margin-left: 0.3em; margin-top: 0.2em; font-size: 11.1999998092651px;"&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt; &lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt;the pno is &lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;2456701 &lt;/SPAN&gt;but I obtain a number like 234534.245670&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt; &lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt;Any help will be very appreciated. &lt;span class="lia-unicode-emoji" title=":monkey_face:"&gt;🐵&lt;/span&gt;&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt; &lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt;Thank you&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt;L.&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Apr 2015 10:02:40 GMT</pubDate>
    <dc:creator>Lorenzom</dc:creator>
    <dc:date>2015-04-03T10:02:40Z</dc:date>
    <item>
      <title>Last decimal truncated</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Last-decimal-truncated/m-p/215629#M53062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="kf" id=":37v" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;Dear all,&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;I am going crazy with this problem.&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;I want to generate a number starting from a date and a string like 2456701&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;I want to obtain a decimal number like xxxxxx,2456701 where xxxx is the difference between a date and a threshold&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P class="kf" style="padding-left: 5px; padding-right: 5px; color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;DIV class="aec" style="font-size: 12.8000001907349px; margin-left: 40px;"&gt;&lt;DIV class="kl" dir="ltr" id=":4ap" style="margin-bottom: 4px;"&gt;length threshold date_formatted site_factor 8.;&lt;/DIV&gt;&lt;DIV class="kl" dir="ltr" style="margin-bottom: 4px;"&gt;&lt;BR /&gt;threshold = put(input('01JAN2000:00:00:00.000', DATETIME22.3),8.);&lt;/DIV&gt;&lt;DIV class="kl" dir="ltr" style="margin-bottom: 4px;"&gt;date_formatted = put(vardate, 8.) ;&lt;BR /&gt;site_factor = date_formatted - treshold;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/DIV&gt;&lt;DIV class="kl" dir="ltr" style="margin-bottom: 4px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; site = site_factor + pno*0.0000001;&lt;/DIV&gt;&lt;DIV class="kl" dir="ltr" id=":4ap" style="margin-bottom: 4px;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P class="kq" style="margin-bottom: 0.2em; color: #777777; margin-left: 0.3em; margin-top: 0.2em; font-size: 11.1999998092651px;"&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt; &lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt;the pno is &lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: medium; background-color: #ffffff;"&gt;2456701 &lt;/SPAN&gt;but I obtain a number like 234534.245670&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt; &lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt;Any help will be very appreciated. &lt;span class="lia-unicode-emoji" title=":monkey_face:"&gt;🐵&lt;/span&gt;&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt; &lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt;Thank you&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt;L.&lt;/DIV&gt;&lt;DIV class="aef" title="Sent at 11:52 AM on Friday"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 10:02:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Last-decimal-truncated/m-p/215629#M53062</guid>
      <dc:creator>Lorenzom</dc:creator>
      <dc:date>2015-04-03T10:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Last decimal truncated</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Last-decimal-truncated/m-p/215630#M53063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are running out of precision. SAS "only" has a mantissa of 52 bytes.&lt;/P&gt;&lt;P&gt;2**52 = 4503599627370496&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 10:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Last-decimal-truncated/m-p/215630#M53063</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-03T10:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Last decimal truncated</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Last-decimal-truncated/m-p/215631#M53064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code that use PUT function and then takes different of the two character values makes no sense to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you can have the accuracy you seek with 8 byte floating point numeric for SITE.&amp;nbsp; You can make it character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps using something like this, after you fix the calculation of SITE.&lt;/P&gt;&lt;P&gt;length site $20;&amp;nbsp; maybe&lt;/P&gt;&lt;P&gt;site = catx(',',site_factor,pno);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 11:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Last-decimal-truncated/m-p/215631#M53064</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-04-03T11:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Last decimal truncated</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Last-decimal-truncated/m-p/215632#M53065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are trying to subtract the two character variables you created with the PUT() function call?&lt;/P&gt;&lt;P&gt;Also there are about 480 million seconds between the beginning of the century and now.&lt;/P&gt;&lt;P&gt;Perhaps you can use minutes or days instead to get a smaller number?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 11:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Last-decimal-truncated/m-p/215632#M53065</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-04-03T11:05:28Z</dc:date>
    </item>
  </channel>
</rss>

