<?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: Match-merging in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Match-merging/m-p/1560#M707</link>
    <description>When merging your data the SAS matched the first observation from your first data set to teh first observation of your second data set.  On the second pass you dont get a match, but rather you get the values retain from the first match and any the values from the second observaton of your first data set overwrite and liked named vars values.&lt;BR /&gt;
&lt;BR /&gt;
If you want a good paper that covers this in detail I suggest you read:&lt;BR /&gt;
&lt;A href="http://dc-sug.org/merge.pdf" target="_blank"&gt;http://dc-sug.org/merge.pdf&lt;/A&gt;  Robert does an outstanding job at showing just the this case and many more.</description>
    <pubDate>Tue, 17 Oct 2006 15:28:31 GMT</pubDate>
    <dc:creator>TobyDunn_hotmail_com</dc:creator>
    <dc:date>2006-10-17T15:28:31Z</dc:date>
    <item>
      <title>Match-merging</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Match-merging/m-p/1559#M706</link>
      <description>I have a question on match-merging. Can someone pls help, or direct me to where I can find a forum dedicated to base sas topics?&lt;BR /&gt;
&lt;BR /&gt;
I don't understand why the 2nd obs in the output shows 32 for age. Shouldn't values from xx OVERWRITE values in yy when the BY variable matches?  I expected age to be 23. My merge statement says:  merge yy xx;&lt;BR /&gt;
&lt;BR /&gt;
----------&lt;BR /&gt;
data xx;&lt;BR /&gt;
  infile cards;&lt;BR /&gt;
  input name $ age $ height;&lt;BR /&gt;
  cards;&lt;BR /&gt;
Adam 23 160&lt;BR /&gt;
&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data yy;&lt;BR /&gt;
	infile cards dsd dlm=' ';&lt;BR /&gt;
	input name $ age $ weight;&lt;BR /&gt;
	cards;&lt;BR /&gt;
Adam  200&lt;BR /&gt;
Adam 32 180&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data merge_yyxx;&lt;BR /&gt;
	merge yy xx;&lt;BR /&gt;
	by name;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=merge_yyxx;&lt;BR /&gt;
run;&lt;BR /&gt;
-------&lt;BR /&gt;
Output:&lt;BR /&gt;
                                      &lt;BR /&gt;
     Obs    name    age    weight    height&lt;BR /&gt;
&lt;BR /&gt;
                                                               1     Adam    23       200       160&lt;BR /&gt;
                                                               2     Adam    32       180       160</description>
      <pubDate>Tue, 17 Oct 2006 15:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Match-merging/m-p/1559#M706</guid>
      <dc:creator>base_SAS</dc:creator>
      <dc:date>2006-10-17T15:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Match-merging</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Match-merging/m-p/1560#M707</link>
      <description>When merging your data the SAS matched the first observation from your first data set to teh first observation of your second data set.  On the second pass you dont get a match, but rather you get the values retain from the first match and any the values from the second observaton of your first data set overwrite and liked named vars values.&lt;BR /&gt;
&lt;BR /&gt;
If you want a good paper that covers this in detail I suggest you read:&lt;BR /&gt;
&lt;A href="http://dc-sug.org/merge.pdf" target="_blank"&gt;http://dc-sug.org/merge.pdf&lt;/A&gt;  Robert does an outstanding job at showing just the this case and many more.</description>
      <pubDate>Tue, 17 Oct 2006 15:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Match-merging/m-p/1560#M707</guid>
      <dc:creator>TobyDunn_hotmail_com</dc:creator>
      <dc:date>2006-10-17T15:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Match-merging</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Match-merging/m-p/1561#M708</link>
      <description>Thanks!! The paper you suggested is great. It brought to light a number of problems and caveats. Thanks again.</description>
      <pubDate>Thu, 19 Oct 2006 22:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Match-merging/m-p/1561#M708</guid>
      <dc:creator>base_SAS</dc:creator>
      <dc:date>2006-10-19T22:53:00Z</dc:date>
    </item>
  </channel>
</rss>

