<?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: merging datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets/m-p/278265#M55965</link>
    <description>&lt;P&gt;1. Sort by variables you'll be merging on&lt;/P&gt;
&lt;P&gt;2. Merge via data step or SQL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before you do, consider what type of merge you want. Is this a one to one match - each record in table 1 has an exat match in table 2?&lt;/P&gt;
&lt;P&gt;Or do you want all records from one table? What if there's no match?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation is very helpful in walking you through a merge and multiple different types of combining data. Here's the link to the&amp;nbsp;Match Merge docs.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#n1tgk0uanvisvon1r26lc036k0w7.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#n1tgk0uanvisvon1r26lc036k0w7.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=data1; by company_name year;
proc sort data=data2; by company_name year;

data want;
merge data1 data2;
by company_name year;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 17 Jun 2016 18:22:18 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-06-17T18:22:18Z</dc:date>
    <item>
      <title>merging datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets/m-p/278243#M55960</link>
      <description>&lt;P&gt;I want to merge two data sets on the basis of company name and year. The two data sets have same company name and same number of years but different variables. Can anyone here help me?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 16:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets/m-p/278243#M55960</guid>
      <dc:creator>Jahanzaib</dc:creator>
      <dc:date>2016-06-17T16:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: merging datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging-datasets/m-p/278265#M55965</link>
      <description>&lt;P&gt;1. Sort by variables you'll be merging on&lt;/P&gt;
&lt;P&gt;2. Merge via data step or SQL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before you do, consider what type of merge you want. Is this a one to one match - each record in table 1 has an exat match in table 2?&lt;/P&gt;
&lt;P&gt;Or do you want all records from one table? What if there's no match?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation is very helpful in walking you through a merge and multiple different types of combining data. Here's the link to the&amp;nbsp;Match Merge docs.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#n1tgk0uanvisvon1r26lc036k0w7.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#n1tgk0uanvisvon1r26lc036k0w7.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=data1; by company_name year;
proc sort data=data2; by company_name year;

data want;
merge data1 data2;
by company_name year;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jun 2016 18:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging-datasets/m-p/278265#M55965</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-17T18:22:18Z</dc:date>
    </item>
  </channel>
</rss>

