<?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: Difference in the precision of TIMESTAMPS between SAP HANA and SAS in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/921973#M28270</link>
    <description>&lt;P&gt;You appear to have hit the limit of precision of the 64bit floating point numbers that SAS uses.&lt;/P&gt;
&lt;P&gt;It does not matter if the number is number of seconds or some other floating point number.&lt;/P&gt;
&lt;PRE&gt;645  data xx;
646    dt='11MAY2011:12:59:08.1231111'dt;
647    put dt datetime28.7;
648    put dt best32.;
649  run;

  11MAY2011:12:59:08.1231110
                1620737948.12311
NOTE: The data set WORK.XX has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.03 seconds


650  data xx;
651   *dt='11MAY2011:12:59:08.1231111'dt;
652    dt=1620737948.123111;
653    put dt datetime28.7;
654    put dt best32.;
655  run;

  11MAY2011:12:59:08.1231110
                1620737948.12311
NOTE: The data set WORK.XX has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Mar 2024 14:16:29 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-03-27T14:16:29Z</dc:date>
    <item>
      <title>Difference in the precision of TIMESTAMPS between SAP HANA and SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/921963#M28269</link>
      <description>&lt;P&gt;We use the data type TIMESTAMP in our SAP HANA Database:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="klroesner_0-1711543481515.png" style="width: 929px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94970iE993ADFCC4FC08CE/image-dimensions/929x98?v=v2" width="929" height="98" role="button" title="klroesner_0-1711543481515.png" alt="klroesner_0-1711543481515.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In Dbeaver it looks correct:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="klroesner_2-1711543559922.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94972i4FFCAF4B094D4643/image-size/medium?v=v2&amp;amp;px=400" role="button" title="klroesner_2-1711543559922.png" alt="klroesner_2-1711543559922.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the SAS EG it looks as if we have a problem with the precision of the Timestamp (Datetime26.7) :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="klroesner_3-1711543593505.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94973i896E2BFD80355F8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="klroesner_3-1711543593505.png" alt="klroesner_3-1711543593505.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is the problem known and is there a solution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 12:53:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/921963#M28269</guid>
      <dc:creator>klroesner</dc:creator>
      <dc:date>2024-03-27T12:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in the precision of TIMESTAMPS between SAP HANA and SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/921973#M28270</link>
      <description>&lt;P&gt;You appear to have hit the limit of precision of the 64bit floating point numbers that SAS uses.&lt;/P&gt;
&lt;P&gt;It does not matter if the number is number of seconds or some other floating point number.&lt;/P&gt;
&lt;PRE&gt;645  data xx;
646    dt='11MAY2011:12:59:08.1231111'dt;
647    put dt datetime28.7;
648    put dt best32.;
649  run;

  11MAY2011:12:59:08.1231110
                1620737948.12311
NOTE: The data set WORK.XX has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.03 seconds


650  data xx;
651   *dt='11MAY2011:12:59:08.1231111'dt;
652    dt=1620737948.123111;
653    put dt datetime28.7;
654    put dt best32.;
655  run;

  11MAY2011:12:59:08.1231110
                1620737948.12311
NOTE: The data set WORK.XX has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Mar 2024 14:16:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/921973#M28270</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-27T14:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in the precision of TIMESTAMPS between SAP HANA and SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/922003#M28272</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301833"&gt;@klroesner&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure (rather skeptical) if the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/fedsqlref/p1uao2myrymg6bn1c5sd610r87cg.htm" target="_blank" rel="noopener"&gt;FedSQL data type&lt;/A&gt; TIMESTAMP(7) might be useful in your case (or if you are using PROC FedSQL at all, cf. &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/fedsqlref/p1hfs88bbog40gn1ir5z4v77pmca.htm" target="_blank" rel="noopener"&gt;Benefits of FedSQL&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, as &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159" target="_blank" rel="noopener"&gt;Tom&lt;/A&gt; has pointed out already, the precision of a (64-bit floating-point) numeric variable in SAS is insufficient for your timestamps. The place value of the least significant bit of a number's binary representation in a numeric variable depends on the number's order of magnitude. As SAS datetime values are measured in seconds since January 1st, 1960, that place value doubles whenever this number of seconds doubles: For datetime values later than 04 Jan 1977 the last bit represents already 1.192E-7 or more seconds, so that the seventh decimal cannot be exact in all cases. Another doubling occurred on 09 Jan 1994 and the next one will occur on 19 Jan 2028. So, as of 2024, the granularity of current datetime values (or from 2011 and 2023 like yours) is &lt;STRONG&gt;2.384E-7&lt;/STRONG&gt; seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way to overcome this limitation is to store the date part and the time part of the timestamp (or alternatively: the integer part and the fractional seconds) in separate numeric variables. The separation could be done on the SAP side where sufficient precision is available or on the SAS side (as shown in the example log below) after importing the timestamp &lt;EM&gt;as a character string&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;384   data _null_;
385   timestamp='2011-05-11 12:59:08.1231111';
386   date=input(scan(timestamp,1,' '),yymmdd10.);
387   time=input(scan(timestamp,2,' '),time20.);
388   format date yymmdd10. time time16.7;
389   put date= time=;
390   run;

date=2011-05-11 time=12:59:08.1231111&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Mar 2024 16:57:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/922003#M28272</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-03-27T16:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in the precision of TIMESTAMPS between SAP HANA and SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/922074#M28276</link>
      <description>&lt;P&gt;Hello FreelanceReinh,&lt;/P&gt;
&lt;P&gt;thanks for the detailed answer... What I do not understand is the default format for timestamps in SAP HANA is Datetime26.7. (&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n1jmk22yyo33xsn13b90bu4agnjh.htm" target="_self"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n1jmk22yyo33xsn13b90bu4agnjh.htm&lt;/A&gt;). But SAS cannot map this in this way? Does that make sense? What do u think?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 07:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/922074#M28276</guid>
      <dc:creator>klroesner</dc:creator>
      <dc:date>2024-03-28T07:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in the precision of TIMESTAMPS between SAP HANA and SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/922076#M28277</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301833"&gt;@klroesner&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;(...) What I do not understand is the default format for timestamps in SAP HANA is Datetime26.7. (&lt;/SPAN&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n1jmk22yyo33xsn13b90bu4agnjh.htm" target="_self"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n1jmk22yyo33xsn13b90bu4agnjh.htm&lt;/A&gt;&lt;SPAN&gt;). But SAS cannot map this in this way? Does that make sense? What do u think?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Think of DATETIME26.7 as a best approximation. On average, the&amp;nbsp;DATETIME26.7-formatted value is closer to the exact value from SAP HANA than the rounded DATETIME26.6-formatted value. And the situation is even better if the seventh decimal place (or the entire fractional seconds part) is constantly zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But they really should have mentioned the limited precision of those values in numeric SAS variables.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 08:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/922076#M28277</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-03-28T08:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in the precision of TIMESTAMPS between SAP HANA and SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/922077#M28278</link>
      <description>&lt;P&gt;SAP has a dedicated TIMESTAMP type, while SAS uses the default 8-byte numeric type to store the value in seconds, with 1960-01-01:00:00:00 as the zero second.&lt;/P&gt;
&lt;P&gt;I&amp;nbsp;&lt;EM&gt;guess&lt;/EM&gt; that internally, SAP uses a separate date and time value, allowing for the greater precision of the time part.&lt;/P&gt;
&lt;P&gt;You will also find other limitations. SAP (like other databases) allows dates starting at 0001-01-01, while SAS does not accept dates before 1582 (the introduction of the Gregorian calendar).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The precision limit for timestamps in most systems was the driver to switch keys from timestamps to UUIDs.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 08:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Difference-in-the-precision-of-TIMESTAMPS-between-SAP-HANA-and/m-p/922077#M28278</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-03-28T08:27:46Z</dc:date>
    </item>
  </channel>
</rss>

