<?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-Merge on different variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Match-Merge-on-different-variables/m-p/432937#M68766</link>
    <description>&lt;P&gt;Just to clarify ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a MERGE, you don't need to rename ahead of time.&amp;nbsp; You can do it on the fly, as you merge:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data Match No_Match;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Merge&amp;nbsp;Dataset1&amp;nbsp;Dataset2 (rename=(BANKACCOUNT=ACCOUNT_NUMBER));;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by ACCOUNT_NUMBER;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if ina and inb then output Match;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else output No_Match;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If both variables are character, make sure they have the same length.&amp;nbsp; There are ways to correct the problem if the lengths are different, but length is an issue that should not be ignored.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2018 22:53:33 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-01-31T22:53:33Z</dc:date>
    <item>
      <title>Match-Merge on different variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Match-Merge-on-different-variables/m-p/432917#M68762</link>
      <description>&lt;P&gt;I have two datasets. One our own and the other a clients. I need to match them. However in our dataset we use Account_Number and the client uses BANKACCOUNT. I need match what accounts are in both datasets to produce a matching dataset and a non-matching dataset for Reconciliation purposes. How can this be done? Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code which does not work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Match No_Match;&lt;BR /&gt;Merge&amp;nbsp;Dataset1&amp;nbsp;Dataset2;&lt;BR /&gt;by ACCOUNT_NUMBER BANKACCOUNT;&lt;BR /&gt;if ina and inb then output Match;&lt;BR /&gt;else output No_Match;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 21:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Match-Merge-on-different-variables/m-p/432917#M68762</guid>
      <dc:creator>HarryT</dc:creator>
      <dc:date>2018-01-31T21:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Match-Merge on different variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Match-Merge-on-different-variables/m-p/432919#M68763</link>
      <description>&lt;P&gt;You have to RENAME the variable for this to work in a data step merge, the variable name needs to be the same. If you merge with SQL you can have different names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 21:23:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Match-Merge-on-different-variables/m-p/432919#M68763</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-31T21:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Match-Merge on different variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Match-Merge-on-different-variables/m-p/432937#M68766</link>
      <description>&lt;P&gt;Just to clarify ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a MERGE, you don't need to rename ahead of time.&amp;nbsp; You can do it on the fly, as you merge:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data Match No_Match;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Merge&amp;nbsp;Dataset1&amp;nbsp;Dataset2 (rename=(BANKACCOUNT=ACCOUNT_NUMBER));;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by ACCOUNT_NUMBER;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if ina and inb then output Match;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else output No_Match;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If both variables are character, make sure they have the same length.&amp;nbsp; There are ways to correct the problem if the lengths are different, but length is an issue that should not be ignored.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 22:53:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Match-Merge-on-different-variables/m-p/432937#M68766</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-01-31T22:53:33Z</dc:date>
    </item>
  </channel>
</rss>

