<?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 connecting an ODBC table to a local table in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/connecting-an-ODBC-table-to-a-local-table/m-p/104173#M29118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp; I'm trying to connect an ODBC table to a local table.. so if I have 2000 record in the local table, I would expect to match to the ODBC table and get 2000 records from it.&amp;nbsp; here is the code I have (below) but for some reason I get &lt;STRONG&gt;way more&lt;/STRONG&gt; than 2000 records..since the ODBC table has 50,000... what am I doing wrong?&amp;nbsp; thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;connect to teradata(user=&amp;amp;user. password=&amp;amp;password. Mode=Teradata tdpid=sdf);&lt;/P&gt;&lt;P&gt;create table A.Data (compress=yes reuse=yes) as&lt;/P&gt;&lt;P&gt;(select a.v_respn_no, a.*, b.*&lt;/P&gt;&lt;P&gt;from A.Local_Table a inner join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Select * from connection to teradata&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (select * from ODBC.Table2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where l_r_id = 'y')) b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on a.evnt_id = b.evnt_id and a.evnt_sys_id = b.evnt_sys__id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;group by 1&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 09 Feb 2013 05:12:28 GMT</pubDate>
    <dc:creator>podarum</dc:creator>
    <dc:date>2013-02-09T05:12:28Z</dc:date>
    <item>
      <title>connecting an ODBC table to a local table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/connecting-an-ODBC-table-to-a-local-table/m-p/104173#M29118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp; I'm trying to connect an ODBC table to a local table.. so if I have 2000 record in the local table, I would expect to match to the ODBC table and get 2000 records from it.&amp;nbsp; here is the code I have (below) but for some reason I get &lt;STRONG&gt;way more&lt;/STRONG&gt; than 2000 records..since the ODBC table has 50,000... what am I doing wrong?&amp;nbsp; thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;connect to teradata(user=&amp;amp;user. password=&amp;amp;password. Mode=Teradata tdpid=sdf);&lt;/P&gt;&lt;P&gt;create table A.Data (compress=yes reuse=yes) as&lt;/P&gt;&lt;P&gt;(select a.v_respn_no, a.*, b.*&lt;/P&gt;&lt;P&gt;from A.Local_Table a inner join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Select * from connection to teradata&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (select * from ODBC.Table2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where l_r_id = 'y')) b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on a.evnt_id = b.evnt_id and a.evnt_sys_id = b.evnt_sys__id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;group by 1&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2013 05:12:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/connecting-an-ODBC-table-to-a-local-table/m-p/104173#M29118</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2013-02-09T05:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: connecting an ODBC table to a local table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/connecting-an-ODBC-table-to-a-local-table/m-p/104174#M29119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We can't tell just from the code why it didn't work; there could be a number of reasons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One comment:&amp;nbsp;&amp;nbsp; When you do a query that involves a local table and a database table, SAS brings the data from the database table over to the SAS server for the join; that can really hammer your performance.&amp;nbsp; If your teradata DBA will allow it, you could get much better through-put by uploading your IDs from a.local_table to the teradata server and do that part of the join there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 14:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/connecting-an-ODBC-table-to-a-local-table/m-p/104174#M29119</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2013-02-11T14:39:10Z</dc:date>
    </item>
  </channel>
</rss>

