<?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: help with inner join to very large table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356426#M83579</link>
    <description>&lt;P&gt;Instead of join. please use hash technique or proc format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;paper for hash join&lt;/P&gt;
&lt;P&gt;&lt;A href="http://analytics.ncsu.edu/sesug/2011/BB08.Lafler.pdf" target="_blank"&gt;http://analytics.ncsu.edu/sesug/2011/BB08.Lafler.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;paper for join with proc format&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,sans-serif;"&gt;&lt;A href="http://www.lexjansen.com/phuse/2007/cc/CC02.pdf" target="_blank"&gt;&lt;FONT color="#0563c1" size="3"&gt;http://www.lexjansen.com/phuse/2007/cc/CC02.pdf&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,sans-serif;"&gt;below is the paper which discusses various lookups something what you are doing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,sans-serif;"&gt;&lt;A href="http://lexjansen.com/nesug/nesug10/cc/cc37.pdf" target="_blank"&gt;http://lexjansen.com/nesug/nesug10/cc/cc37.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2017 14:59:16 GMT</pubDate>
    <dc:creator>kiranv_</dc:creator>
    <dc:date>2017-05-05T14:59:16Z</dc:date>
    <item>
      <title>help with inner join to very large table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356394#M83574</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm trying to do an inner join but when attempting to join to a particular table, i find myself aborting the query as it is takes too long, or I end up receiving an error message (will post when it appears again).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has coding suggestion (maybe there is a more efficient way of coding my join to a large table), please let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc sql; create table want as&lt;BR /&gt;Select a.*&lt;BR /&gt;From have as a, database_historical_table b where&lt;BR /&gt;a.ID_2=b.ID_2 and a.event_date=b.date and b.ID_status='';quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My table "have", has only 30 records. The table "&lt;SPAN&gt;database_historical_table&lt;/SPAN&gt;", refreshes daily for all of our card customers, so has billion of records.&lt;/P&gt;&lt;P&gt;ID2 is 16 text char.&lt;/P&gt;&lt;P&gt;The date range is within april '17.&lt;/P&gt;&lt;P&gt;The ID_status is 1 char.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 14:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356394#M83574</guid>
      <dc:creator>brulard</dc:creator>
      <dc:date>2017-05-05T14:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: help with inner join to very large table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356413#M83576</link>
      <description>&lt;P&gt;I can't really tell from what you post. &amp;nbsp;Some&amp;nbsp;&lt;STRONG&gt;test data in the form of a datastep and what the output should look like&lt;/STRONG&gt; would go some ways to clarifying. &amp;nbsp;I would suspect having a smaller intermediary table first off would minimise the rows needed:&lt;/P&gt;
&lt;PRE&gt;proc sql; 
  create table WANT as
  select  A.*
  from    HAVE A
  left join (select * from database_historical_table where ID_STATUS="") B 
  on      a.ID_2=b.ID_2 and a.event_date=b.date;
quit;&lt;/PRE&gt;
&lt;P&gt;That will shrink it, however if you have that many rows it will still be long. &amp;nbsp;SQL probably isnt the tool to do large data. &amp;nbsp;Show what you have and what you want and will be able to say more.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 14:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356413#M83576</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-05T14:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: help with inner join to very large table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356426#M83579</link>
      <description>&lt;P&gt;Instead of join. please use hash technique or proc format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;paper for hash join&lt;/P&gt;
&lt;P&gt;&lt;A href="http://analytics.ncsu.edu/sesug/2011/BB08.Lafler.pdf" target="_blank"&gt;http://analytics.ncsu.edu/sesug/2011/BB08.Lafler.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;paper for join with proc format&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,sans-serif;"&gt;&lt;A href="http://www.lexjansen.com/phuse/2007/cc/CC02.pdf" target="_blank"&gt;&lt;FONT color="#0563c1" size="3"&gt;http://www.lexjansen.com/phuse/2007/cc/CC02.pdf&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,sans-serif;"&gt;below is the paper which discusses various lookups something what you are doing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,sans-serif;"&gt;&lt;A href="http://lexjansen.com/nesug/nesug10/cc/cc37.pdf" target="_blank"&gt;http://lexjansen.com/nesug/nesug10/cc/cc37.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 14:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356426#M83579</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-05-05T14:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: help with inner join to very large table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356432#M83580</link>
      <description>&lt;P&gt;First, create a sorted sub-dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
  data=database_historical_table (
    keep=ID_2 date ID_status
    rename=(date=event_date)
    where=(ID_status = '')
  )
  out=big_table (
    drop=ID_status
  )
;
by ID_2 event_date;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then, do a data step merge on the tables:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
merge
  have (in=a)
  big_table (in=b)
;
by ID_2 event_date;
if a and b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;have should also be sorted first, of course.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The crucial thing is not to have proc sql build a monster utility file and do a gazillion of read/writes to/from that&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 15:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356432#M83580</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-05T15:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: help with inner join to very large table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356475#M83588</link>
      <description>&lt;P&gt;And an index to&amp;nbsp;the large table. &amp;nbsp;Proc SQL should be able to use the index if it exists.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 16:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-with-inner-join-to-very-large-table/m-p/356475#M83588</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-05T16:48:35Z</dc:date>
    </item>
  </channel>
</rss>

