<?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: proc sql takes hours to run in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sql-takes-hours-to-run/m-p/518476#M32640</link>
    <description>&lt;P&gt;Check if the underlying Teradata table have any partitions or indexes.&amp;nbsp;Your query is going for a full table scan which is not optimal . Consider splitting your query into smaller subsets as suggested by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To check the Underlying partitions/indexes in you table use the syntax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Show table &amp;lt;table_name&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also I would suggest running a sample query to test the waters&amp;nbsp; before running query without&amp;nbsp;filters :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;

%connect_to_teradata_dna06;

create table TotalData_27NOV18 as

select * from connection to tera

(

select *

from bsp_bd_sd_dna06.kde_cdb_pcust_totaldata_19nov18

&lt;FONT color="#FF0000"&gt;&lt;EM&gt;sample 1000&lt;/EM&gt;&lt;/FONT&gt;
);

disconnect from tera;

quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Dec 2018 16:44:34 GMT</pubDate>
    <dc:creator>r_behata</dc:creator>
    <dc:date>2018-12-04T16:44:34Z</dc:date>
    <item>
      <title>proc sql takes hours to run</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sql-takes-hours-to-run/m-p/518470#M32638</link>
      <description>&lt;P&gt;Hello, I'm trying to run what I thought is some quite simple code, but it's taking hours to complete.&amp;nbsp; I'm trying to create a table in SAS using data from a table in Teradata.&amp;nbsp; There should be around 26 million rows.&amp;nbsp; Does anyone have any idea what the problem could be?&amp;nbsp; I should say that I have only been using SAS for around four weeks and haven't had any training!&amp;nbsp; I'm used to Oracle SQL.&amp;nbsp; My code is here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;creator&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;connect_to_teradata_dna06&lt;/I&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;create table TotalData_27NOV18 as&lt;/P&gt;&lt;P&gt;select * from connection to tera&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from bsp_bd_sd_dna06.kde_cdb_pcust_totaldata_19nov18&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;disconnect from tera;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;%mend&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;creator;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 16:28:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sql-takes-hours-to-run/m-p/518470#M32638</guid>
      <dc:creator>JulieM39</dc:creator>
      <dc:date>2018-12-04T16:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql takes hours to run</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sql-takes-hours-to-run/m-p/518472#M32639</link>
      <description>Does it work for smaller subsets at all? That's not a huge query and should take less than 20 minutes in my experience so I would be checking your network speeds. &lt;BR /&gt;&lt;BR /&gt;Have you tried using a libname instead of sql pass through?</description>
      <pubDate>Tue, 04 Dec 2018 16:33:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sql-takes-hours-to-run/m-p/518472#M32639</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-04T16:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql takes hours to run</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sql-takes-hours-to-run/m-p/518476#M32640</link>
      <description>&lt;P&gt;Check if the underlying Teradata table have any partitions or indexes.&amp;nbsp;Your query is going for a full table scan which is not optimal . Consider splitting your query into smaller subsets as suggested by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To check the Underlying partitions/indexes in you table use the syntax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Show table &amp;lt;table_name&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also I would suggest running a sample query to test the waters&amp;nbsp; before running query without&amp;nbsp;filters :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;

%connect_to_teradata_dna06;

create table TotalData_27NOV18 as

select * from connection to tera

(

select *

from bsp_bd_sd_dna06.kde_cdb_pcust_totaldata_19nov18

&lt;FONT color="#FF0000"&gt;&lt;EM&gt;sample 1000&lt;/EM&gt;&lt;/FONT&gt;
);

disconnect from tera;

quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 16:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sql-takes-hours-to-run/m-p/518476#M32640</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2018-12-04T16:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql takes hours to run</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sql-takes-hours-to-run/m-p/518499#M32641</link>
      <description>&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 17:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sql-takes-hours-to-run/m-p/518499#M32641</guid>
      <dc:creator>JulieM39</dc:creator>
      <dc:date>2018-12-04T17:22:18Z</dc:date>
    </item>
  </channel>
</rss>

