<?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 two data-sets using the &amp;quot;by&amp;quot; statement when variable names are different in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/match-merging-two-data-sets-using-the-quot-by-quot-statement/m-p/103160#M291227</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;rename the variable in the merge statement so they are the same or use PROC SQL.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG style="color: #222222; font-size: small; background-color: #ffffff;"&gt;DATA dataC;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG style="color: #222222; font-size: small; background-color: #ffffff;"&gt;MERGE dataA dataB (rename=varB=var1);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="color: #222222; font-size: small; background-color: #ffffff; font-family: arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;BY var1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial; font-size: small; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Dec 2012 20:07:23 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2012-12-18T20:07:23Z</dc:date>
    <item>
      <title>match merging two data-sets using the "by" statement when variable names are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-merging-two-data-sets-using-the-quot-by-quot-statement/m-p/103159#M291226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial; font-size: small; background-color: #ffffff;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial; font-size: small; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial; font-size: small; background-color: #ffffff;"&gt;when merging two data sets using the by statement, like in this example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial; font-size: small; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG style="color: #222222; font-size: small; background-color: #ffffff;"&gt;DATA dataC;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG style="color: #222222; font-size: small; background-color: #ffffff;"&gt;MERGE dataA dataB;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="color: #222222; font-size: small; background-color: #ffffff; font-family: arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;BY var1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial; font-size: small; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial; font-size: small; background-color: #ffffff;"&gt;I can match-merge the observations of two datasets (dataA and dataB) into a new dataset (dataC) using a specified variable (var1) as the key.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial; font-size: small; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-size: 10pt; background-color: #ffffff; font-family: arial;"&gt;However, is there an easy way when merging two datasets using the "by" statement where the variable names are different in deach dataset? &lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-family: arial; font-size: small;"&gt;For example, if i dataA the variable is called var1 and in dataB the variable is called varB?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-family: arial; font-size: small;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-family: arial; font-size: small;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-family: arial; font-size: small;"&gt;P.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 19:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-merging-two-data-sets-using-the-quot-by-quot-statement/m-p/103159#M291226</guid>
      <dc:creator>pmdci</dc:creator>
      <dc:date>2012-12-18T19:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: match merging two data-sets using the "by" statement when variable names are different</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-merging-two-data-sets-using-the-quot-by-quot-statement/m-p/103160#M291227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;rename the variable in the merge statement so they are the same or use PROC SQL.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG style="color: #222222; font-size: small; background-color: #ffffff;"&gt;DATA dataC;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG style="color: #222222; font-size: small; background-color: #ffffff;"&gt;MERGE dataA dataB (rename=varB=var1);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="color: #222222; font-size: small; background-color: #ffffff; font-family: arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;BY var1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial; font-size: small; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 20:07:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-merging-two-data-sets-using-the-quot-by-quot-statement/m-p/103160#M291227</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-12-18T20:07:23Z</dc:date>
    </item>
  </channel>
</rss>

