<?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 Problem with Hadoop timestamps in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Hadoop-timestamps/m-p/833824#M329655</link>
    <description>&lt;DIV class="line number3 index2 alt2"&gt;I need to extract data&amp;nbsp; from hive tables that contain timestamps.&amp;nbsp; The timestamp values are adjusted by exactly 1 or 2 hours when copying the tables to SAS.&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;This means that datetime values that should be 31DEC9999:00:00:00 are extracted as 30DEC9999:23:00:00.&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;How can this be prevented.&amp;nbsp; &amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;The options timezone is blank.&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;The server is in Germany and I suspect that the difference of 1 or 2 hours depends on whether it is summer (day light savings) time winter.&amp;nbsp; &amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;
&lt;PRE&gt;libname pdoa hadoop uri="jdbc:hive2://datalab-hive-prod.gslb.db.com:10000/pr_pwcc_analysis;principal=hive/datalab-hive-prod.gslb.db.com@DBG.ADS.DB.COM;ssl=true?mapreduce.job.queuename=root.ACE-S-FRA-DATALAB-PROD-PC_PDOA;"&amp;nbsp;server="datalab-hive-prod.gslb.db.com"&amp;nbsp;port=10000&amp;nbsp;schema="pc_pdoa_analysis_pcb_nemp";&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;PRE&gt;&lt;BR /&gt;data pdoa;
set pdoa.Eap_pd697h;
where active=1 and partid=4000300;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the same extract is done using ODBC, then the expected values are extracted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can work-around the issue using pass-thru and the from_utc_timestamp fucnction.&lt;/P&gt;
&lt;PRE&gt;proc sql;
connect to hadoop (uri="jdbc:hive2://datalab-hive-prod.gslb.db.com:10000/pr_pwcc_analysis;principal=hive/datalab-hive-prod.gslb.db.com@DBG.ADS.DB.COM;ssl=true?mapreduce.job.queuename=root.PWCC.ACE-S-FRA-DATALAB-PROD-PC_PDOA" server="datalab-hive-prod.gslb.db.com" port=10000 schema="pc_pdoa_analysis_pcb_nemp" READ_METHOD=HDFS);
  create table test_pdoa as select * from connection to hadoop
(   
 SELECT from_utc_timestamp(ts_to,"Europe/Berlin") as ts_berlin,
*
FROM Eap_pd697h
where active=1 and partid=4000300
);
disconnect from hadoop ;
quit;
&lt;/PRE&gt;
&lt;P&gt;My question is:&amp;nbsp; Is there a way to adjust the libname statement so that the "from_utc_timestamp" conversion is applied to all timestamp / datetime columns automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 12:01:40 GMT</pubDate>
    <dc:creator>DavePrinsloo</dc:creator>
    <dc:date>2022-09-16T12:01:40Z</dc:date>
    <item>
      <title>Problem with Hadoop timestamps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Hadoop-timestamps/m-p/833824#M329655</link>
      <description>&lt;DIV class="line number3 index2 alt2"&gt;I need to extract data&amp;nbsp; from hive tables that contain timestamps.&amp;nbsp; The timestamp values are adjusted by exactly 1 or 2 hours when copying the tables to SAS.&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;This means that datetime values that should be 31DEC9999:00:00:00 are extracted as 30DEC9999:23:00:00.&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;How can this be prevented.&amp;nbsp; &amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;The options timezone is blank.&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;The server is in Germany and I suspect that the difference of 1 or 2 hours depends on whether it is summer (day light savings) time winter.&amp;nbsp; &amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="line number3 index2 alt2"&gt;
&lt;PRE&gt;libname pdoa hadoop uri="jdbc:hive2://datalab-hive-prod.gslb.db.com:10000/pr_pwcc_analysis;principal=hive/datalab-hive-prod.gslb.db.com@DBG.ADS.DB.COM;ssl=true?mapreduce.job.queuename=root.ACE-S-FRA-DATALAB-PROD-PC_PDOA;"&amp;nbsp;server="datalab-hive-prod.gslb.db.com"&amp;nbsp;port=10000&amp;nbsp;schema="pc_pdoa_analysis_pcb_nemp";&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;PRE&gt;&lt;BR /&gt;data pdoa;
set pdoa.Eap_pd697h;
where active=1 and partid=4000300;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the same extract is done using ODBC, then the expected values are extracted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can work-around the issue using pass-thru and the from_utc_timestamp fucnction.&lt;/P&gt;
&lt;PRE&gt;proc sql;
connect to hadoop (uri="jdbc:hive2://datalab-hive-prod.gslb.db.com:10000/pr_pwcc_analysis;principal=hive/datalab-hive-prod.gslb.db.com@DBG.ADS.DB.COM;ssl=true?mapreduce.job.queuename=root.PWCC.ACE-S-FRA-DATALAB-PROD-PC_PDOA" server="datalab-hive-prod.gslb.db.com" port=10000 schema="pc_pdoa_analysis_pcb_nemp" READ_METHOD=HDFS);
  create table test_pdoa as select * from connection to hadoop
(   
 SELECT from_utc_timestamp(ts_to,"Europe/Berlin") as ts_berlin,
*
FROM Eap_pd697h
where active=1 and partid=4000300
);
disconnect from hadoop ;
quit;
&lt;/PRE&gt;
&lt;P&gt;My question is:&amp;nbsp; Is there a way to adjust the libname statement so that the "from_utc_timestamp" conversion is applied to all timestamp / datetime columns automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 12:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Hadoop-timestamps/m-p/833824#M329655</guid>
      <dc:creator>DavePrinsloo</dc:creator>
      <dc:date>2022-09-16T12:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Hadoop timestamps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Hadoop-timestamps/m-p/834616#M329946</link>
      <description>&lt;P&gt;You could look at the timezone option, but i suspect that's a rabbit hole more complex than the workaround you have in place.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/nlsref/n0px72paaaqx06n1ozps024j78cl.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/nlsref/n0px72paaaqx06n1ozps024j78cl.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 06:18:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Hadoop-timestamps/m-p/834616#M329946</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2022-09-22T06:18:54Z</dc:date>
    </item>
  </channel>
</rss>

