<?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: Mergers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517723#M140038</link>
    <description>&lt;P&gt;You have not supplied your log nor explained what issue you have.&lt;/P&gt;
&lt;P&gt;I suspect that one or both of your data sets are not sorted&amp;nbsp; properly.&lt;/P&gt;
&lt;P&gt;Both should be sorted by same key - country - in your case:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=dataA; by country; run;
proc sort data=dataB; by country; run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;data wanted;&lt;BR /&gt;merge dataA (in=in1) dataB (in=in2);&lt;BR /&gt;by Country;  /* you had a comma instead a semicolon */&amp;nbsp;&lt;BR /&gt;run;&lt;/PRE&gt;</description>
    <pubDate>Sat, 01 Dec 2018 06:32:31 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2018-12-01T06:32:31Z</dc:date>
    <item>
      <title>Mergers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517721#M140037</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get the desired dataset with the following command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data wanted;&lt;/P&gt;&lt;P&gt;merge dataA (in=in1) dataB (in=in2);&lt;/P&gt;&lt;P&gt;by Country,&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But with no luck. any help is appreciated! Thanks!!!!&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 05:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517721#M140037</guid>
      <dc:creator>aidant01</dc:creator>
      <dc:date>2018-12-01T05:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Mergers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517723#M140038</link>
      <description>&lt;P&gt;You have not supplied your log nor explained what issue you have.&lt;/P&gt;
&lt;P&gt;I suspect that one or both of your data sets are not sorted&amp;nbsp; properly.&lt;/P&gt;
&lt;P&gt;Both should be sorted by same key - country - in your case:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=dataA; by country; run;
proc sort data=dataB; by country; run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;data wanted;&lt;BR /&gt;merge dataA (in=in1) dataB (in=in2);&lt;BR /&gt;by Country;  /* you had a comma instead a semicolon */&amp;nbsp;&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Dec 2018 06:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517723#M140038</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-12-01T06:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Mergers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517725#M140039</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/236226"&gt;@aidant01&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to get the desired dataset with the following command&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data wanted;&lt;/P&gt;
&lt;P&gt;merge dataA (in=in1) dataB (in=in2);&lt;/P&gt;
&lt;P&gt;by Country&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But with no luck. any help is appreciated! Thanks!!!!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 06:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517725#M140039</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-12-01T06:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Mergers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517736#M140041</link>
      <description>&lt;P&gt;Maxim 2: Read the Log.&lt;/P&gt;
&lt;P&gt;Which implies that it is always a good idea to post the log when steps do not work as expected, as it allows us to interpret your log, find the problem, and show&amp;nbsp;&lt;EM&gt;you&lt;/EM&gt; how to interpret SAS logs. Reading and getting information from the log is an essential SAS skill.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also do not provide data in Excel spreadsheets; spreadsheets have no structure like datasets, and it's never given that the re-import into SAS results in a dataset like yours. Post example data in a data set with datalines.&lt;/P&gt;
&lt;P&gt;With Excel, I need to&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;download the spreadsheet&lt;/LI&gt;
&lt;LI&gt;open it with Excel to save as csv&lt;/LI&gt;
&lt;LI&gt;copy the csv to the server&lt;/LI&gt;
&lt;LI&gt;run proc import or a data step, while making guesses about the structure&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;With a data step, I have to&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;copy paste to a code window&lt;/LI&gt;
&lt;LI&gt;submit the code&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;and there are no ambiguities with regards to structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro from one of my footnotes can do the conversion of a dataset to a data step automatically.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 09:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517736#M140041</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-01T09:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Mergers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517815#M140060</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data &amp;nbsp;mergeddata;&lt;/P&gt;&lt;P&gt;merge datasetA (in=in1) datasetB (in=in2);&lt;/P&gt;&lt;P&gt;by country;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-12-02 at 1.00.51 PM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25314i198968E94D04BEA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-12-02 at 1.00.51 PM.png" alt="Screen Shot 2018-12-02 at 1.00.51 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 06:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517815#M140060</guid>
      <dc:creator>aidant01</dc:creator>
      <dc:date>2018-12-02T06:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Mergers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517841#M140074</link>
      <description>&lt;P&gt;Since you have a many-to-many relationship, and want a cartesian join, you need to use proc sql.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 08:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mergers/m-p/517841#M140074</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-02T08:40:18Z</dc:date>
    </item>
  </channel>
</rss>

