<?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: Datepart taking longer time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Datepart-taking-longer-time/m-p/564273#M158260</link>
    <description>Where is the HAVE table? If it's not also on the oracle server it's taking a lot of time because linking data between the server and locally first means getting all the data in the same place. If you need to speed it up, I'd run the filter first based on the ID's to reduce the size and then do the date filter in a second step.</description>
    <pubDate>Thu, 06 Jun 2019 19:24:00 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-06-06T19:24:00Z</dc:date>
    <item>
      <title>Datepart taking longer time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datepart-taking-longer-time/m-p/564258#M158253</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have oracle table  which has date time variable and I need to create sas table with date9 format. Oracle table has more than 30million records. It takes lot of time to extract data due to conversion. Any help in optimization would be really great help&lt;BR /&gt; Below is the sample code &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Proc sql;&lt;BR /&gt;Create table t1 as &lt;BR /&gt;Select a.* , b.reporting_date format=date9. &lt;BR /&gt;from have left join oracle_lib b&lt;BR /&gt;On a. Id=b.id where datepart(b.Reporting_date) =a. Eff_from_date;&lt;BR /&gt;Quit;&lt;BR /&gt;&lt;BR /&gt;In another code reporting _date has value like 06Jun2019:00:00:00&lt;BR /&gt;Eff_from_date has values like 06-Jun-2019&lt;BR /&gt;&lt;BR /&gt;Any help in reducing the time is of really good help. &lt;BR /&gt;</description>
      <pubDate>Thu, 06 Jun 2019 18:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datepart-taking-longer-time/m-p/564258#M158253</guid>
      <dc:creator>yashpande</dc:creator>
      <dc:date>2019-06-06T18:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Datepart taking longer time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datepart-taking-longer-time/m-p/564273#M158260</link>
      <description>Where is the HAVE table? If it's not also on the oracle server it's taking a lot of time because linking data between the server and locally first means getting all the data in the same place. If you need to speed it up, I'd run the filter first based on the ID's to reduce the size and then do the date filter in a second step.</description>
      <pubDate>Thu, 06 Jun 2019 19:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datepart-taking-longer-time/m-p/564273#M158260</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-06T19:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Datepart taking longer time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datepart-taking-longer-time/m-p/564350#M158288</link>
      <description>Have table is sas table.</description>
      <pubDate>Fri, 07 Jun 2019 03:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datepart-taking-longer-time/m-p/564350#M158288</guid>
      <dc:creator>yashpande</dc:creator>
      <dc:date>2019-06-07T03:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Datepart taking longer time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datepart-taking-longer-time/m-p/564484#M158350</link>
      <description>Then you need to redesign your process, did you try my suggested approach, where you first filter based on ID's from a macro variable instead and then filter on dates?&lt;BR /&gt;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select id into :id_list separated by " "&lt;BR /&gt;from have;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;Proc sql;&lt;BR /&gt;Create table t1 as &lt;BR /&gt;Select id, reporting_date&lt;BR /&gt;from oracle_lib a&lt;BR /&gt;where a.id in (&amp;amp;id_list.);&lt;BR /&gt;Quit;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You also never have an aliased table named A in your code.</description>
      <pubDate>Fri, 07 Jun 2019 15:03:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datepart-taking-longer-time/m-p/564484#M158350</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-07T15:03:42Z</dc:date>
    </item>
  </channel>
</rss>

