<?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: SAS Merge in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499379#M15536</link>
    <description>&lt;P&gt;10000 can be handled with a format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataset1;
input id name $;
cards;
1 ABC
2 CDF
3 KLM
4 JKL
;
run;

data dataset2;
input id1 id2 id3;
cards;
1 2 3
3 . 4
;
run;

data cntlin;
set dataset1;
rename id=start name=label;
fmtname='idname';
type='N';
run;

proc format cntlin=cntlin;
run;

data want;
set dataset2;
array ids{*} id:;
length name $20;
do i = 1 to dim(ids);
  if not missing(ids{i}) then name=catx(',',name,put(ids{i},idname.));
end;
drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Sep 2018 06:20:51 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-09-27T06:20:51Z</dc:date>
    <item>
      <title>SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499346#M15534</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tow dataset, dataset1 (contains ID &amp;amp; Name) &amp;amp; dataset2 (contains Id1,Id2 &amp;amp; Id3) ,values of dataset2 variable coming from&amp;nbsp;&lt;SPAN&gt;dataset1&amp;nbsp;variables (ID). later i want to join them in a single DATA step. Can you please help me how i can perform SAS&amp;nbsp;merging to get my final output metion in&amp;nbsp;FinalDataset dataset.&amp;nbsp; In real time datsets contains more then 10000+ records.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATASET1:&lt;/P&gt;&lt;P&gt;ID NAME&lt;/P&gt;&lt;P&gt;1 ABC&lt;BR /&gt;2 CDF&lt;BR /&gt;3 KLM&lt;BR /&gt;4 JKL&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATASET2:&lt;/P&gt;&lt;P&gt;ID1 ID2 ID3&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;1 2 3&lt;BR /&gt;3 . 4&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;AFTER MERGING DATSET1 &amp;amp; DATASET2 THE FINAL DATASET WOULD BE:&lt;/P&gt;&lt;P&gt;FinalDataset:&lt;/P&gt;&lt;P&gt;ID1 ID2 ID3 NAME&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;1 2 3 ABC,CDF,KLM&lt;BR /&gt;3 . 4 KLM,JKL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you !!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 02:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499346#M15534</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-09-27T02:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499351#M15535</link>
      <description>&lt;P&gt;A very simple hash find()=0 pull&amp;nbsp;&lt;/P&gt;
&lt;P&gt;load dtset1 in hash table&amp;nbsp;&lt;/P&gt;
&lt;P&gt;loop through array id1-id3&lt;/P&gt;
&lt;P&gt;use each of those array elements as keys &amp;amp; pull the names with find method&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 02:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499351#M15535</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-27T02:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499379#M15536</link>
      <description>&lt;P&gt;10000 can be handled with a format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataset1;
input id name $;
cards;
1 ABC
2 CDF
3 KLM
4 JKL
;
run;

data dataset2;
input id1 id2 id3;
cards;
1 2 3
3 . 4
;
run;

data cntlin;
set dataset1;
rename id=start name=label;
fmtname='idname';
type='N';
run;

proc format cntlin=cntlin;
run;

data want;
set dataset2;
array ids{*} id:;
length name $20;
do i = 1 to dim(ids);
  if not missing(ids{i}) then name=catx(',',name,put(ids{i},idname.));
end;
drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 06:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499379#M15536</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-09-27T06:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499545#M15537</link>
      <description>&lt;P&gt;To illustrate what i said last night:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataset1;
input id name $;
cards;
1 ABC
2 CDF
3 KLM
4 JKL
;
run;

data dataset2;
input id1 id2 id3;
cards;
1 2 3
3 . 4
;
run;

data want(drop=id name);
if 0 then set dataset2  dataset1;
dcl hash h(dataset:'dataset1',ordered:'y');
h.definekey('id');
h.definedata('name');
h.definedone();
do until(lr);
set dataset2 end=lr;
array t id1-id3;
length new_name $20;
call missing(new_name);
do over t;
_iorc_=h.find(key:t);
if _iorc_=0 then new_name=catx(',',new_name,name);
end;
output;
end;
stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 15:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499545#M15537</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-27T15:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499760#M15538</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just a nit.&amp;nbsp; You don't need the "ordered:'a'" parameter for this code, since the hash object in not to be output.&amp;nbsp; You only need the hash for lookup - adding the ordered attribute will slow down building the hash and retrieving from it.&amp;nbsp; Compare the below with vs without the ordered attribute:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  declare hash h (ordered:'a');
    h.definekey('x');
	h.definedata('x','y');
	h.definedone();

  do x=1 to 10000000;y=-1*x;h.add();end;
  /*do x=1 to 10000000;h.find();end;*/
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Sep 2018 03:08:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499760#M15538</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-09-28T03:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499763#M15540</link>
      <description>&lt;P&gt;Thank you Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;.&amp;nbsp; I want to take advantage of you to allow me a major request at a truly convenient time of yours. i know you may be busy with wharton, family and self etc. However, when and if time, heart, mind and soul permits, may i request you to pen down how you often efficiently&lt;/P&gt;
&lt;P&gt;1. use self merge datastep&lt;/P&gt;
&lt;P&gt;2. your classy wayof using lag on a condition&lt;/P&gt;
&lt;P&gt;3. interleave akin to 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do and when you do and supposing that &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;you may use some well simulated use cases&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;, kindly plug me plz.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My mom(retired forex analyst and doesn't have an account here) often reads your thread with greater attention to detail. So, If it's not a bother, I wish you may.Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;PS If that happens, our library is probably the best place to post for the benefit of wider audience&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 03:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/499763#M15540</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-28T03:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/500109#M15547</link>
      <description>&lt;P&gt;Dear sir ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for letting me know this approach of merging.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried same approach for more then one variable , but getting unexpected output. Below is my code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dataset3;&lt;BR /&gt;input id site name $;&lt;BR /&gt;cards;&lt;BR /&gt;1 22 ABC&lt;BR /&gt;2 22 CDF&lt;BR /&gt;3 22 KLM&lt;BR /&gt;4 34 JKL&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data dataset4;&lt;BR /&gt;input id1 id2 id3 site;&lt;BR /&gt;cards;&lt;BR /&gt;1 2 3 22&lt;BR /&gt;3 . 4 34&lt;BR /&gt;4 . . 34&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data test (keep=id name);&lt;BR /&gt;set dataset3;&lt;BR /&gt;id=strip(id)||strip(site);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data test1 (keep=id1 id2 id3);&lt;BR /&gt;set dataset4;&lt;BR /&gt;if id1 ne . and site ne . then id1=strip(id1)||strip(site);&lt;BR /&gt;if id2 ne . and site ne . then id2=strip(id2)||strip(site);&lt;BR /&gt;if id3 ne . and site ne . then id3=strip(id3)||strip(site);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data cntlin2;&lt;BR /&gt;set test;&lt;BR /&gt;rename id=start name=label;&lt;BR /&gt;fmtname='idnamee';&lt;BR /&gt;type='N';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=cntlin2 nodupkey;&lt;BR /&gt;by start;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc format cntlin=cntlin2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want1;&lt;BR /&gt;set test1;&lt;BR /&gt;array ids{*} id:;&lt;BR /&gt;length name $20;&lt;BR /&gt;do i = 1 to dim(ids);&lt;BR /&gt;if not missing(ids{i}) then name=catx(',',name,put(ids{i},idnamee.));&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Final Output :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="dijitContentPane dijitBorderContainer-child dijitBorderContainer-dijitContentPane dijitBorderContainerPane dijitAlignCenter dijitContentPaneSingleChild"&gt;&lt;DIV class="dgrid dgrid-grid ui-widget"&gt;&lt;DIV class="dgrid-header dgrid-header-row ui-widget-header"&gt;&amp;nbsp;OBS&lt;DIV class="dgrid-sort-arrow ui-icon"&gt;&amp;nbsp;&lt;/DIV&gt;id1&lt;DIV class="dgrid-resize-handle resizeNode-1"&gt;&amp;nbsp;&lt;/DIV&gt;&amp;nbsp;id2&lt;DIV class="dgrid-resize-handle resizeNode-2"&gt;&amp;nbsp;&lt;/DIV&gt;&amp;nbsp;id3&lt;DIV class="dgrid-resize-handle resizeNode-3"&gt;&amp;nbsp;&lt;/DIV&gt;&amp;nbsp;name&lt;DIV class="dgrid-resize-handle resizeNode-4"&gt;&amp;nbsp;&lt;/DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="dgrid-scroller"&gt;&lt;DIV class="dgrid-content ui-widget-content"&gt;&lt;DIV class=" dgrid-row dgrid-row-even ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;122&lt;/TD&gt;&lt;TD&gt;222&lt;/TD&gt;&lt;TD&gt;322&lt;/TD&gt;&lt;TD&gt;ABC,CDF,KLM&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-odd ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;334&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;434&lt;/TD&gt;&lt;TD&gt;334,JKL&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row ui-state-default dgrid-row-even"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;434&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;JKL&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once again Thank you !!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 29 Sep 2018 15:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/500109#M15547</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-09-29T15:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/500273#M15552</link>
      <description>&lt;P&gt;You have an ID in test1/id1 that has no match in test (334), so the format will display the value as-is.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 06:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/500273#M15552</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-01T06:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/500286#M15553</link>
      <description>&lt;P&gt;Dear Sir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please elaborate , in this case how to get only matching record.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks...&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 09:32:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/500286#M15553</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-10-01T09:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/500318#M15558</link>
      <description>&lt;P&gt;Expand the format with a value for "Other" and check for that before concatenating:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataset3;
input id site name $;
cards;
1 22 ABC
2 22 CDF
3 22 KLM
4 34 JKL
;
run;

data dataset4;
input id1 id2 id3 site;
cards;
1 2 3 22
3 . 4 34
4 . . 34
;
run;

data test (keep=id name);
set dataset3;
id=strip(id)||strip(site);
run;

data test1 (keep=id1 id2 id3);
set dataset4;
if id1 ne . and site ne . then id1=strip(id1)||strip(site);
if id2 ne . and site ne . then id2=strip(id2)||strip(site);
if id3 ne . and site ne . then id3=strip(id3)||strip(site);
run;

data cntlin2;
set test (rename=(id=start name=label)) end=eof ;
fmtname='idnamee';
type='N';
output;
if eof
then do;
  start = .;
  label = '***';
  hlo = 'O';
  output;
end;
run;

proc sort data=cntlin2 nodupkey;
by start;
run;

proc format cntlin=cntlin2;
run;

data want1;
set test1;
array ids{*} id:;
length name $20;
do i = 1 to dim(ids);
if not missing(ids{i}) and put(ids{i},idnamee.) ne '***'
then name=catx(',',name,put(ids{i},idnamee.));
end;
drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Oct 2018 12:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/500318#M15558</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-01T12:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506097#M15701</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;: Hello Sir,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all , i'm thank full to you to share the new concept of data merge specially for me . Today i get a chance to learn hash concept and got stuck on solving the same question by adding one more matching variable (or more then one matching variable) . Here i'm not sure how i'll use new variable with array as key. Below is the sample dataset, where i added one more matching variable site and trying to getting same output as pasted below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dataset1;&lt;BR /&gt;input id site name $;&lt;BR /&gt;cards;&lt;BR /&gt;1 22 ABC&lt;BR /&gt;2 22 CDF&lt;BR /&gt;3 22 KLM&lt;BR /&gt;4 34 JKL&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data dataset2;&lt;BR /&gt;input id1 id2 id3 site;&lt;/P&gt;&lt;P&gt;cards;&lt;BR /&gt;1 2 3 22&lt;BR /&gt;3 . 4 34&lt;BR /&gt;4 . . 34&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24215iE1FF1AF8A1F3238D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:19:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506097#M15701</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-10-19T18:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506100#M15702</link>
      <description>&lt;P&gt;Haha Plz don;t call me Sir. I haven't earned it/nor I deserve it.&lt;/P&gt;
&lt;P&gt;To your question, give me sometime as I am away from SAS software now. Will respond soon as i can&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506100#M15702</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-19T18:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506123#M15703</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153275"&gt;@singhsahab&lt;/a&gt;&amp;nbsp;Ok, adding site to the&amp;nbsp;data will not produce any changes to your result because the key in the hash table is ID and data value id name. So the look up is basically from each element in your array i.e id1-id3 to id in hash table to get the name value. This is the existing logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to explain "&lt;SPAN&gt;Here i'm not sure how i'll use new variable with array as key.&amp;nbsp;" in terms of what do you want to use as look up keys to fetch what as you have added site variable in both datasets. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Are you looking to use composite hash keys using id+site? Your requirement is not quite clear&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:56:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506123#M15703</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-19T18:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506240#M15706</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;: Yes,i,m&amp;nbsp;&lt;SPAN&gt;looking to use composite hash keys using id+site to join dataset. I define site as a key but getting error.&amp;nbsp; I'm not sure how i will use composite key to join.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 463px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24223i5753578832A290B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 18:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506240#M15706</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-10-20T18:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506242#M15707</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataset1;
input id site name $;
cards;
1 22 ABC
2 22 CDF
3 22 KLM
4 34 JKL
;
run;

data dataset2;
input id1 id2 id3 site;

cards;
1 2 3 22
3 . 4 34
4 . . 34
;
run;


data want(drop=id name);
if 0 then set dataset2  dataset1;
dcl hash h(dataset:'dataset1');
h.definekey('id','site');
h.definedata('name');
h.definedone();
do until(lr);
set dataset2 end=lr;
array t id1-id3;
length new_name $20;
call missing(new_name);
do over t;
_iorc_=h.find(key:t,key:site);
if _iorc_=0 then new_name=catx(',',new_name,name);
end;
output;
end;
stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Oct 2018 18:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506242#M15707</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-20T18:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506243#M15708</link>
      <description>&lt;P&gt;And a note:&amp;nbsp; There's something to keep in mind if you are playing with very very very large dataset and composite keys as hash keys that would not fit in memory and may have to be treated with MD5 or SHA256 hash algorithms to make it compatible. However, in my 5+ years of SAS experience, I haven't encountered the need to be concerned about that yet. But always good to be aware though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 18:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506243#M15708</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-20T18:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506244#M15709</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp; .. Thank you so much . I'll keep it in mind. Just have one more query .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i declared has object as below. Does it's feasible in comparison open declaration of hash object .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if _n_=1 then do;&lt;BR /&gt;declare hash h(dataset:'test1');&lt;BR /&gt;h.definekey('id','site');&lt;BR /&gt;h.definedata('name');&lt;BR /&gt;h.definedone();&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 18:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506244#M15709</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-10-20T18:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506245#M15710</link>
      <description>&lt;P&gt;I don't comprehend what you mean by "&lt;SPAN&gt;&amp;nbsp;open declaration"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Are you trying to mean:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;open declaration is&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if _n_=1 then do;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;dcl hash statements......&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;end;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;vs&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;just&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;dcl hash....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If that above is what your question is, I'd suggest the not so regular hash users to use the one you suggested as opposed to the style i showed that loops through the set until the confidence and expertise gets to a certain level.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There will be a time, as the requirement narrates to the mind, the code&amp;nbsp; is in the fingers. This is when we feel we are in SAS world &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 19:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Merge/m-p/506245#M15710</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-20T19:04:26Z</dc:date>
    </item>
  </channel>
</rss>

