<?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: join table simple in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545497#M74307</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data A;
input id mret;
datalines;
1   8
2   5
3   9
;
proc sort data=a;
	by id;
run;
data B;
input id MP;
datalines;
1   96
2   6
3   5
;
proc sort data=bl
	by id;
run;
data want;
	merge a b;
	by id;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 23 Mar 2019 16:48:38 GMT</pubDate>
    <dc:creator>VDD</dc:creator>
    <dc:date>2019-03-23T16:48:38Z</dc:date>
    <item>
      <title>join table simple</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545496#M74306</link>
      <description>&lt;P&gt;&amp;nbsp;I want to join two table in this ways&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;table A&lt;/P&gt;
&lt;P&gt;id mret&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp;8&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;5&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp;9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;table B&lt;/P&gt;
&lt;P&gt;id MP&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp;96&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;6&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp;5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table want&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id mret MP&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp;96&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp;6&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 16:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545496#M74306</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2019-03-23T16:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: join table simple</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545497#M74307</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data A;
input id mret;
datalines;
1   8
2   5
3   9
;
proc sort data=a;
	by id;
run;
data B;
input id MP;
datalines;
1   96
2   6
3   5
;
proc sort data=bl
	by id;
run;
data want;
	merge a b;
	by id;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Mar 2019 16:48:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545497#M74307</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-23T16:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: join table simple</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545499#M74308</link>
      <description>&lt;P&gt;or with SQL&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A;
input id mret;
datalines;
1   8
2   5
3   9
;

data B;
input id MP;
datalines;
1   96
2   6
3   5
;
proc sql;
	create table want as
	select a.*,b.mp
	from a as a,
	     b as b
	where a.id=b.id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Mar 2019 16:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545499#M74308</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-23T16:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: join table simple</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545500#M74309</link>
      <description>&lt;P&gt;can you please give me a solution which did not use id because I have same id missing.&lt;/P&gt;
&lt;P&gt;just add a column to table A form table b&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 16:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545500#M74309</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2019-03-23T16:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: join table simple</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545501#M74310</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data A;
input id mret;
datalines;
1   8
2   5
3   9
.   3
;
proc sort data=a;
	by id;
run;
data B;
input id MP;
datalines;
1   96
2   6
3   5
.   33
;
proc sort data=b;
	by id;
run;
data want;
	merge a b;
	by id;
	where id ne .;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sql;
	create table want as
	select a.*,b.mp
	from a as a,
	     b as b
	where a.id=b.id
	     and(a.id ne . and b.id ne .);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the solutions provided were quick here is how you can do that.&lt;/P&gt;
&lt;P&gt;for a more in-depth solution use the same concept as this accepted solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="background-color: #ffffff;"&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/repeat-observation-by-id/m-p/490130#M72083" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Procedures/repeat-observation-by-id/m-p/490130#M72083&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 17:17:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/join-table-simple/m-p/545501#M74310</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-23T17:17:22Z</dc:date>
    </item>
  </channel>
</rss>

