<?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: Subseting Teradata table with SAS dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22557#M3660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.&amp;nbsp; Yikes!&amp;nbsp; As Patrick noted above, there is a limit of 4,500 unique values in the WHERE clause produced by MULTI_DATASRC_OPT.&amp;nbsp; For the fastest performance, and complete results, you'll need to upload the SAS table (ACCT_NBR column only, of course) to Teradata and do the join there.&amp;nbsp; Take a look at the BULKLOAD=YES option for the libname statement in the &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63144/HTML/default/viewer.htm#n0ht8i7t92tocpn18vn0krftm85m.htm"&gt;Maximizing Teradata Load Performance&lt;/A&gt; article in the online docs - this can make uploading the SAS table many times faster that an conventional row-by-row load. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Because of the way the second query is written, SAS must fetch the data from the Teradata tables into SAS to complete the processing.&amp;nbsp; The LIBNAME engine may be multi-threading and creating individual connections for each table you are reading.&amp;nbsp; You are reading 7 Teradata tables, the the Teradata error is complaining about 7 concurrent sessions.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again, uploading the ACCT_NBR column from the SAS table to Teradata before you execute this query will probably resolve the issue.&amp;nbsp; The LIBNAME engine should then be able to push the entire process into Teradata.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get&amp;nbsp; a better handle on what's actually happening by using the SAS options &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63144/HTML/default/viewer.htm#n0732u1mr57ycrn1urf24gzo38sc.htm"&gt;SASTRACE, SASTRACELOC and NOTSUFFIX&lt;/A&gt;.&amp;nbsp; Try submitting this OPTIONS statement before the SQL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;options sastrace=',,,d' sastraceloc=saslog nostsuffix;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, after submitting the SQL code, you can see in the SAS log exactly what SQL was passed to the Teradata instance.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2012 03:39:59 GMT</pubDate>
    <dc:creator>SASJedi</dc:creator>
    <dc:date>2012-01-05T03:39:59Z</dc:date>
    <item>
      <title>Subseting Teradata table with SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22553#M3656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;STRONG&gt;Happy New Year SAS Communities...!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;Here is my problem question&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have ~90 Million record in my master table (Teradata table) and I have another SAS dataset with 1 Million record.&lt;BR /&gt;Both of these table contains account numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to query the teradata table based on account number using the account numbers from SAS dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following code to do that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LIBNAME X "/dhana/inputfile";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;PROC SQL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESET INOBS=MAX OUTOBS=MAX LOOPS=MAX NOFLOW NOFEEDBACK NOPROMPT NONUMBER ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONNECT TO TERADATA(TDPID=TERADT USER=%SYSGET(USER) PASSWORD=%SYSGET(PASSWD));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CREATE TABLE X.ALL_ACCTS AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SELECT * FROM CONNECTION TO TERADATA(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SELECT VAR1, VAR2, VAR3, VAR4, VAR5, VAR5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM TABLE1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHERE ACCT_NBR IN( SELECT ACCT_NBR FROM X.SAS_DATASET)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;QUIT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like I can't use the SAS dataset in the Teradata SQL pass through query. &lt;BR /&gt;I am getting the following error message - &lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt;Teradata prepare: Database 'X' does not exist.&lt;/SPAN&gt;&lt;BR /&gt;Is there any way I can subset the teradata table with the account numbers from my SAS dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Dhanas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2012 15:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22553#M3656</guid>
      <dc:creator>dhana</dc:creator>
      <dc:date>2012-01-02T15:51:14Z</dc:date>
    </item>
    <item>
      <title>Subseting Teradata table with SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22554#M3657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To simplify matters, use implicit passthrough with the &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63144/HTML/default/viewer.htm#n0tcetvx1zpnayn1r8actrkjrd5o.htm"&gt;MULTI_DATASRC_OPT=&lt;/A&gt; option on the LIBNAME statement, and the &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63144/HTML/default/viewer.htm#n0jg0sozl17mjyn1woelrrr76266.htm"&gt;DBMASTER=&lt;/A&gt; dataset option on the Teradata table reference during the join.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code will look SOMETHING like this:&lt;/P&gt;&lt;PRE&gt; 
LIBNAME X "C:\MY_SASDATA";
LIBNAME TD teradata&amp;nbsp; TDPID=TERADT USER="%SYSGET(USER)" 
&amp;nbsp;&amp;nbsp; PASSWORD="%SYSGET(PASSWD)" multi_datasrc_opt=in_clause;

PROC SQL;
CREATE TABLE X.ALL_ACCTS AS
&amp;nbsp;&amp;nbsp; SELECT VAR1, VAR2, VAR3, VAR4, VAR5, VAR5
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM TD.TABLE1(dbmaster=yes) AS TD
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , X.SAS_DATASET AS SAS
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE TD.ACCT_NBR =SAS.ACCT_NBR 
;
QUIT;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2012 21:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22554#M3657</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2012-01-02T21:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Subseting Teradata table with SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22555#M3658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really like SASJedi's approach. The only possible issue I see with it is:&lt;/P&gt;&lt;P&gt;The SAS Doc for MULTI_DATASRC_OPT states "&lt;EM&gt;Currently, the IN clause has a limit of 4,500 unique values&lt;/EM&gt;".&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002205740.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002205740.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternative approach could be to load the SAS dataset into a temporary table in Teradata and then join these 2 tables. &lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002677096.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002677096.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2012 02:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22555#M3658</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-01-03T02:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Subseting Teradata table with SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22556#M3659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Thanks SASJedi...!&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;This is really an excellent option and answer. I tried this option it worked perfectly. But I have faced 2 problems.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;1. &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;When I try to merge one teradata table with SAS dataset , I have found an interesting thing. Though the SAS dataset contains approximately 1 Million record and all the account numbers are &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; present in the teradata table, the query returned only ~15718 records.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Can you help me why I am getting very less record returned from the query.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;2.&amp;nbsp; When I try to merge 7 teradata tables along with the SAS dataset then I got the following error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt;ERROR: Teradata connection: TWM Workload violation: Limit of 7 concurrent sessions, for User XXXXXX, During rule state&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Batch-Normal.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #000000; font-family: calibri, verdana, arial, sans-serif;"&gt;Do you have any idea why I am getting this error or any suggestion.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #000000; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #000000; font-family: calibri, verdana, arial, sans-serif;"&gt;This is the code I am using --- &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #000000; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LIBNAME _ALL_ CLEAR;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LIBNAME X "/dhana/inputfile/";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LIBNAME TD TERADATA TDPID=TERADT USER=%SYSGET(USER) PASSWORD=%SYSGET(PASSWD) SCHEMA=XXXXXXX MULTI_DATASRC_OPT=IN_CLAUSE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;PROC SQL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SELECT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A.VAR1,A.VAR2,A.VAR3,B.VAR1,B.VAR2,B.VAR3,B.VAR4,B.VAR5,B.VAR6,B.VAR7,C.VAR1,C.VAR2,C.VAR3,C.VAR4,D.VAR1,D.VAR2,E.VAR1,F.VAR1,G.VAR1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;TD.TABLE1 B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;TD.TABLE2 A&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ON A.ACCT_ID=B.ACCT_ID AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A.EFF_DT=B.EFF_DT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;TD.TABLE3 C&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ON A.ACCT_ID=C.ACCT_ID AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A.EFF_DT=C.EFF_DT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;TD.TABLE4 D&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ON A.ACCT_ID=D.ACCT_ID AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A.EFF_DT=D.EFF_DT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;TD.TABLE5 E&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ON A.ACCT_ID=E.ACCT_ID AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A.EFF_DT=E.EFF_DT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;TD.TABLE6 F&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ON A.ACCT_ID=F.ACCT_ID AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A.EFF_DT=F.EFF_DT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;TD.TABLE7 G&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ON A.ACCT_ID=G.ACCT_ID AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A.EFF_DT=G.EFF_DT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHERE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;B.EFF_DT='2011-11-30'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AND C.VAR6='D'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AND B.ACCT_NBR IN(SELECT ACCT_NBR FROM X.CCLDRIVER)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ORDER BY B.ACCT_NBR, B.ACCT_ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;QUIT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LIBNAME _ALL_ CLEAR;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Thanks &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Dhanasekaran R&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2012 18:04:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22556#M3659</guid>
      <dc:creator>dhana</dc:creator>
      <dc:date>2012-01-03T18:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Subseting Teradata table with SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22557#M3660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.&amp;nbsp; Yikes!&amp;nbsp; As Patrick noted above, there is a limit of 4,500 unique values in the WHERE clause produced by MULTI_DATASRC_OPT.&amp;nbsp; For the fastest performance, and complete results, you'll need to upload the SAS table (ACCT_NBR column only, of course) to Teradata and do the join there.&amp;nbsp; Take a look at the BULKLOAD=YES option for the libname statement in the &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63144/HTML/default/viewer.htm#n0ht8i7t92tocpn18vn0krftm85m.htm"&gt;Maximizing Teradata Load Performance&lt;/A&gt; article in the online docs - this can make uploading the SAS table many times faster that an conventional row-by-row load. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Because of the way the second query is written, SAS must fetch the data from the Teradata tables into SAS to complete the processing.&amp;nbsp; The LIBNAME engine may be multi-threading and creating individual connections for each table you are reading.&amp;nbsp; You are reading 7 Teradata tables, the the Teradata error is complaining about 7 concurrent sessions.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again, uploading the ACCT_NBR column from the SAS table to Teradata before you execute this query will probably resolve the issue.&amp;nbsp; The LIBNAME engine should then be able to push the entire process into Teradata.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get&amp;nbsp; a better handle on what's actually happening by using the SAS options &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63144/HTML/default/viewer.htm#n0732u1mr57ycrn1urf24gzo38sc.htm"&gt;SASTRACE, SASTRACELOC and NOTSUFFIX&lt;/A&gt;.&amp;nbsp; Try submitting this OPTIONS statement before the SQL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;options sastrace=',,,d' sastraceloc=saslog nostsuffix;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, after submitting the SQL code, you can see in the SAS log exactly what SQL was passed to the Teradata instance.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 03:39:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22557#M3660</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2012-01-05T03:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Subseting Teradata table with SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22558#M3661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You SASJedi...! I will try this option and will come back if I run into any issues...! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Dhanasekaran R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 20:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subseting-Teradata-table-with-SAS-dataset/m-p/22558#M3661</guid>
      <dc:creator>dhana</dc:creator>
      <dc:date>2012-01-06T20:36:19Z</dc:date>
    </item>
  </channel>
</rss>

