<?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 How to extract data for last 1/2 hour? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17500#M102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for a SAS equivalent for the following:&lt;/P&gt;&lt;P&gt;TIMESTAMP &amp;gt;=SYSDATE-30/1440&lt;/P&gt;&lt;P&gt;is used to extract data based on the 1/2 hour window defined in the condition.&lt;/P&gt;&lt;P&gt;I need to define this in the WHERE caluse of an EXTRACT transformation in DIS job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Feb 2012 20:38:50 GMT</pubDate>
    <dc:creator>Halaku</dc:creator>
    <dc:date>2012-02-28T20:38:50Z</dc:date>
    <item>
      <title>How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17500#M102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for a SAS equivalent for the following:&lt;/P&gt;&lt;P&gt;TIMESTAMP &amp;gt;=SYSDATE-30/1440&lt;/P&gt;&lt;P&gt;is used to extract data based on the 1/2 hour window defined in the condition.&lt;/P&gt;&lt;P&gt;I need to define this in the WHERE caluse of an EXTRACT transformation in DIS job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 20:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17500#M102</guid>
      <dc:creator>Halaku</dc:creator>
      <dc:date>2012-02-28T20:38:50Z</dc:date>
    </item>
    <item>
      <title>How to extract data for last one hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17501#M103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If TIMESTAMP is a SAS datetime value then the condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;intck("MINUTE", TIMESTAMP, DATETIME(), "CONTINUOUS") &amp;lt;= 30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will get the timestamps from the last half hour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 20:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17501#M103</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-02-28T20:55:33Z</dc:date>
    </item>
    <item>
      <title>How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17502#M104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. &lt;/P&gt;&lt;P&gt;The column value is coming from Oracle that needs to be within 30 minutes time period. So based on the timestamp value from that column I need to get only those records which have a time stamp of last 30 minutes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 21:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17502#M104</guid>
      <dc:creator>Halaku</dc:creator>
      <dc:date>2012-02-28T21:12:07Z</dc:date>
    </item>
    <item>
      <title>How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17503#M105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I am not familiar with Oracle, bu I assume that the proper translation is done with timestamps when imported to SAS. Good luck. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 21:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17503#M105</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-02-28T21:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17504#M106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't tell us which DI version you're using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe intck() is a SAS function which can't be passed to Oracle &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003113612.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003113612.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If so then better don't use it in a where clause when extracting data from Oracle as this would result in the whole table loaded from Oracle to SAS for processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you could do:&lt;/P&gt;&lt;P&gt;Use DI's SQL join transformation and select the pass-through option, then simply use the already known Oracle syntax in the where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm suggesting a SQL join transformation because I understand the Extract transformation as a subset of the SQL join transformation. It happened to me more than once that I needed to modify an extract step by adding a table for further selection. When using an Extract transformation this means to redo everything (replace it with a SQL join), when using a SQL join transformation from the beginning then it's just modifying what's already there.&lt;/P&gt;&lt;P&gt;(in the SQL join transformation diagram view simply delete the "join" node and you get what the Extract transformation does).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 01:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17504#M106</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-02-29T01:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17505#M107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good point Patrick. This might work instead, if SAS SQL can optimize out the constant before sending it to Oracle:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where datestamp &amp;gt;= intnx("MINUTE", DATETIME(), -30, "SAME")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 02:22:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17505#M107</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-02-29T02:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17506#M108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't see intnx() listed as a function passed to Oracle&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003113612.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003113612.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that you have in mind that eventually SAS converts the intnx() function to a constant and then passes this constant to Oracle for execution (converting it to a value appropriate for Oracle datetimes). &lt;/P&gt;&lt;P&gt;I don't think that this can/should work this way but that it's always about converting SAS functions to Oracle functions and then send the command to Oracle for execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've seen more than one environment where clocks on different servers were not in sync. So using intnx() with datetime() on the SAS side to generate a value would use the SAS server clock but then execute the where clause on the Oracle server with the clock there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 03:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17506#M108</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-02-29T03:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17507#M109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; The result of intnx which in this case will be a datetime constant would be passed to Oracle. That is just a guess, of course. One must try it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 03:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17507#M109</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-02-29T03:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17508#M110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See my previous post. Sorry - was updating it while you posted your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 03:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17508#M110</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-02-29T03:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17509#M111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; You are right Patrick. Then Halaku is stuck with using a pass-through query :smileycry: !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 03:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17509#M111</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-02-29T03:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17510#M112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think so. I often use the technique to create date or datetime constants stored in macro variables.&lt;/P&gt;&lt;P&gt;This can be done in the pre code of the job or in a transformation.&lt;/P&gt;&lt;P&gt;The Oracle libname engine should be able to convert them properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 06:40:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17510#M112</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-02-29T06:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17511#M113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're then passing this like&amp;nbsp; "&amp;amp;DateString"d&amp;nbsp; right? That should work and be sent to Oracle using function&amp;nbsp; to_date(...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue with clocks not in sync on different servers remains. I've seen this in real life situations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 10:14:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17511#M113</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-02-29T10:14:59Z</dc:date>
    </item>
    <item>
      <title>How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17512#M114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; That's right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since they extract half an hour at the time, it doesn't seem like a real time application.&lt;/P&gt;&lt;P&gt;So I would postpone the extract with a reasonable margin (according to differences between computer clocks), and the use BETWEEN-AND logic in the extract.&lt;/P&gt;&lt;P&gt;If the source data base is in a different time zone, the that has to be taken care of in the pre code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 11:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17512#M114</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-03-01T11:13:15Z</dc:date>
    </item>
    <item>
      <title>How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17513#M115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Given that "sysdate" in Oracle is a datetimestamp, one could use sysdate- (1800)&amp;nbsp;&amp;nbsp; (with the appropriate syntax around it) as part of the Oracle passthru where clause ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 20:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17513#M115</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2012-03-01T20:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17514#M116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Over the weekend I tried a few things, not pretty and I do not understand it fully but it worked.&lt;/P&gt;&lt;P&gt;Here is what I used to perform the extraction:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;UPDATETIME &amp;gt; %sysfunc(datetime())- (60*30)&lt;/H4&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still have to understand fully the working of %sysfunc, can any one explain? Is this the right approach?:smileyconfused:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using DIS 4.21&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 14:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17514#M116</guid>
      <dc:creator>Halaku</dc:creator>
      <dc:date>2012-03-05T14:45:52Z</dc:date>
    </item>
    <item>
      <title>How to extract data for last 1/2 hour?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17515#M117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have put a reply, please read and if you have any suggestions...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 18:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-extract-data-for-last-1-2-hour/m-p/17515#M117</guid>
      <dc:creator>Halaku</dc:creator>
      <dc:date>2012-03-05T18:47:06Z</dc:date>
    </item>
  </channel>
</rss>

