<?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: How to write the code if I would like to get the same result by using 'merge' function? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693480#M211453</link>
    <description>Try FULL JOIN .&lt;BR /&gt;Better post sample data ,and can test the code .</description>
    <pubDate>Thu, 22 Oct 2020 12:30:31 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-10-22T12:30:31Z</dc:date>
    <item>
      <title>How to write the code if I would like to get the same result by using 'merge' function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693407#M211414</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running code like below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL;
	CREATE TABLE want.C  AS
	SELECT DISTINCT
	*
	FROM
	have.A as A
	JOIN have.B AS B ON A.family_id=B.family_id
	;
QUIT;&lt;/PRE&gt;&lt;P&gt;my question is: How to write the code if I would like to get the same result by using 'merge' function?&lt;/P&gt;&lt;P&gt;I try to use&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data want.C;
	merge have.A 
	have.B;
	by family_id;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I did not get the same result. could you please give me some suggestions about this?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 07:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693407#M211414</guid>
      <dc:creator>Alexxxxxxx</dc:creator>
      <dc:date>2020-10-22T07:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the code if I would like to get the same result by using 'merge' function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693410#M211416</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want.C;
	merge have.A (in=a)
	have.B (in=b);
	by family_id;
	if a and b;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 07:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693410#M211416</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-10-22T07:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the code if I would like to get the same result by using 'merge' function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693414#M211418</link>
      <description>&lt;P&gt;The data step MERGE cannot mimic the SQL join if there is a many-to-many relationship.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 07:54:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693414#M211418</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-22T07:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the code if I would like to get the same result by using 'merge' function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693415#M211419</link>
      <description>Thanks for your reply. but what should I do? the result of SQL is 'Error: Sort execution failure.' Could you please give me some suggestions about this?</description>
      <pubDate>Thu, 22 Oct 2020 07:57:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693415#M211419</guid>
      <dc:creator>Alexxxxxxx</dc:creator>
      <dc:date>2020-10-22T07:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the code if I would like to get the same result by using 'merge' function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693418#M211422</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/262815"&gt;@Alexxxxxxx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks for your reply. but what should I do? the result of SQL is 'Error: Sort execution failure.' Could you please give me some suggestions about this?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;See your other thread about this.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 08:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693418#M211422</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-22T08:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the code if I would like to get the same result by using 'merge' function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693480#M211453</link>
      <description>Try FULL JOIN .&lt;BR /&gt;Better post sample data ,and can test the code .</description>
      <pubDate>Thu, 22 Oct 2020 12:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-if-I-would-like-to-get-the-same-result-by/m-p/693480#M211453</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-10-22T12:30:31Z</dc:date>
    </item>
  </channel>
</rss>

