<?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: where expression in exctration - datetime field in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316240#M270911</link>
    <description>&lt;P&gt;IMO an easier way to do it (and probably more effective) is to use tha autoamtic date/time variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"&amp;amp;SYSDATE:&amp;amp;SYSTIME"dt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;amp;SYSTIME is in minutes, no need for trucation logic...&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2016 12:55:57 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-12-02T12:55:57Z</dc:date>
    <item>
      <title>where expression in exctration - datetime field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316194#M270909</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm extracting data from an Oracle table and using SAS Data Integration Studio (DI).&lt;/P&gt;&lt;P&gt;The Oracle expression in the where condition is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA_CARICAMENTO &amp;gt;= TRUNC(SYSDATE - 1, 'MI') AND DATA_CARICAMENTO &amp;lt;= SYSDATE&lt;/PRE&gt;&lt;P&gt;I would use an equivalent expression in the Extract transformation of DI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA_CARICAMENTO's Format is Datetime20.&lt;/P&gt;&lt;P&gt;Do you know what's a correct expression I can use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 10:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316194#M270909</guid>
      <dc:creator>niespolo</dc:creator>
      <dc:date>2016-12-02T10:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: where expression in exctration - datetime field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316199#M270910</link>
      <description>&lt;P&gt;A little googling for "Oracle trunc function" revealed that this truncates the value to the minute.&lt;/P&gt;
&lt;P&gt;So I guess that the low end for the comparison is the minute of 1 second past.&lt;/P&gt;
&lt;P&gt;In SAS, that would be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;today() * 86400 + intnx('minute',time()-1,0,'begin')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;if I guess right.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 10:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316199#M270910</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-02T10:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: where expression in exctration - datetime field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316240#M270911</link>
      <description>&lt;P&gt;IMO an easier way to do it (and probably more effective) is to use tha autoamtic date/time variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"&amp;amp;SYSDATE:&amp;amp;SYSTIME"dt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;amp;SYSTIME is in minutes, no need for trucation logic...&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 12:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316240#M270911</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-12-02T12:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: where expression in exctration - datetime field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316242#M270912</link>
      <description>&lt;P&gt;Caution: &amp;amp;sysdate and &amp;amp;systime contain the date and time when the SAS session was started, not the current date and time!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 13:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316242#M270912</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-02T13:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: where expression in exctration - datetime field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316271#M270913</link>
      <description>&lt;P&gt;Agree, but usually the Extract step is in the beginning of the session.&lt;/P&gt;
&lt;P&gt;But in DI Studio, there's also&amp;nbsp;automatic datetime macro variables created for you, so my final (?) suggestion would be to use ETLS_STARTTIME (or similar name, don't have DI Studio at my fingertips).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 15:11:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-expression-in-exctration-datetime-field/m-p/316271#M270913</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-12-02T15:11:21Z</dc:date>
    </item>
  </channel>
</rss>

