<?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: Hash Join in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Hash-Join/m-p/235856#M268190</link>
    <description>&lt;P&gt;This paper provides example of Hash merging using 2 keys.... &amp;nbsp;Refer to page 5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/forum2008/029-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/029-2008.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;</description>
    <pubDate>Sat, 21 Nov 2015 14:37:11 GMT</pubDate>
    <dc:creator>kannand</dc:creator>
    <dc:date>2015-11-21T14:37:11Z</dc:date>
    <item>
      <title>Hash Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hash-Join/m-p/235843#M268188</link>
      <description>&lt;P&gt;Please help with the code for hash join , for the below code in PROC SQL&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc sql;&lt;/P&gt;
&lt;P&gt;Create table test as&lt;/P&gt;
&lt;P&gt;Select *&lt;/P&gt;
&lt;P&gt;From dsn1 a inner join dsn2 b&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On a.key1=b.key2 or a.key1a=b.key2;&lt;/P&gt;
&lt;P&gt;Quit;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 10:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hash-Join/m-p/235843#M268188</guid>
      <dc:creator>msbrvamsi</dc:creator>
      <dc:date>2015-11-21T10:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Hash Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hash-Join/m-p/235851#M268189</link>
      <description>&lt;P&gt;Appears a thread exists for probably what you are looking for...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/HASH-join/m-p/112108#U112108" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/HASH-join/m-p/112108#U112108&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 13:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hash-Join/m-p/235851#M268189</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-11-21T13:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hash Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hash-Join/m-p/235856#M268190</link>
      <description>&lt;P&gt;This paper provides example of Hash merging using 2 keys.... &amp;nbsp;Refer to page 5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/forum2008/029-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/029-2008.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 14:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hash-Join/m-p/235856#M268190</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-11-21T14:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Hash Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hash-Join/m-p/235870#M268191</link>
      <description>&lt;P&gt;Providing sample data would help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below code sample assumes that the key in "dsn2" is unique. If this is not the case then you would need tag "multidata" in the hash and you would need to loop over the hash entries with the same key if there is a match.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dsn1;
  input key1 key1a @@;
  source1='dsn1';
  output;
  datalines;
1 1 1 2 9 2 9 9
;
run;

data dsn2;
  input key2 @@;
  source2='dsn2';
  output;
  datalines;
1 2 3
;
run;

data want(drop=_rc);
  set dsn1;

  if _n_=1 then
    do;
      if 0 then set dsn2;
      dcl hash h(dataset:'dsn2');
      _rc=h.defineKey('key2');
      _rc=h.defineData(all:'y');
      _rc=h.defineDone();
    end;

  if h.find(key:key1)=0 then
    do;
      match='key1 ';
      output;
    end;
  else if h.find(key:key1a)=0 then
    do;
      match='key1a';
      output;
    end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 21 Nov 2015 23:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hash-Join/m-p/235870#M268191</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-11-21T23:45:04Z</dc:date>
    </item>
  </channel>
</rss>

