<?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: Conditioanal merging in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/459975#M116876</link>
    <description>&lt;P&gt;Sort d1 and d2 by store_postcode then:&lt;/P&gt;
&lt;PRE&gt;data want;
  merge d1 d2;
  by store_postcode;
run;&lt;/PRE&gt;
&lt;P&gt;Is that your question as I don't see anything conditional?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 May 2018 09:51:40 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-05-04T09:51:40Z</dc:date>
    <item>
      <title>Conditioanal merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/459971#M116872</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two dataset data1 and data2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data1.&lt;/P&gt;&lt;P&gt;store_postcode&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data2.&lt;/P&gt;&lt;P&gt;store_postcode price month&lt;/P&gt;&lt;P&gt;2 32 1&lt;/P&gt;&lt;P&gt;5 65 3&lt;/P&gt;&lt;P&gt;3 87 2&lt;/P&gt;&lt;P&gt;1 89 3&lt;/P&gt;&lt;P&gt;6 56 5&lt;/P&gt;&lt;P&gt;8 45 7&lt;/P&gt;&lt;P&gt;4 67 4&lt;/P&gt;&lt;P&gt;7 49 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i want to merge dataset2 in dataset1 by store_postcode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 09:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/459971#M116872</guid>
      <dc:creator>apxprdtr10</dc:creator>
      <dc:date>2018-05-04T09:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Conditioanal merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/459975#M116876</link>
      <description>&lt;P&gt;Sort d1 and d2 by store_postcode then:&lt;/P&gt;
&lt;PRE&gt;data want;
  merge d1 d2;
  by store_postcode;
run;&lt;/PRE&gt;
&lt;P&gt;Is that your question as I don't see anything conditional?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 09:51:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/459975#M116876</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-04T09:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Conditioanal merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/459976#M116877</link>
      <description>&lt;P&gt;as you can see there is no store_postcode named 9 in dataset2. and that's where i want conditional merging.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 09:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/459976#M116877</guid>
      <dc:creator>apxprdtr10</dc:creator>
      <dc:date>2018-05-04T09:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conditioanal merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/459978#M116879</link>
      <description>&lt;P&gt;This does not mean anything to me.&amp;nbsp; Do you mean you only want values which appear in one dataset?&amp;nbsp; If so then add:&lt;/P&gt;
&lt;PRE&gt;data want;
  merge d1 (in=a) d2 (in=b);
  by store_postcode;&lt;BR /&gt;  if a and b;
run;&lt;/PRE&gt;
&lt;P&gt;The above will keep only observations where data is in both datasets.&amp;nbsp; You could do:&lt;/P&gt;
&lt;P&gt;if a;&lt;/P&gt;
&lt;P&gt;For only those records in the first, or&lt;/P&gt;
&lt;P&gt;if b;&lt;/P&gt;
&lt;P&gt;for those only in the second.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 09:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/459978#M116879</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-04T09:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Conditioanal merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/460117#M116939</link>
      <description>&lt;P&gt;Show your desired output. The example is small enough that should not be difficult.&lt;/P&gt;
&lt;P&gt;A description that can be interpreted in multiple ways leads to lots of clarifying questions.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 17:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditioanal-merging/m-p/460117#M116939</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-04T17:34:36Z</dc:date>
    </item>
  </channel>
</rss>

