<?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 Merging in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging/m-p/474762#M122032</link>
    <description>&lt;P&gt;Name EmpID&lt;BR /&gt;---- -----&lt;BR /&gt;Jill 1864&lt;BR /&gt;Jack 2121&lt;BR /&gt;Joan 4698&lt;BR /&gt;John 5463&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Given the SAS data set WORK.EMP_DEPT:&lt;BR /&gt;EmpID Department&lt;BR /&gt;----- ----------&lt;BR /&gt;2121 Accounting&lt;BR /&gt;3567 Finance&lt;BR /&gt;4698 Marketing&lt;BR /&gt;5463 Accounting&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The following program is submitted:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data WORK.ALL;&lt;BR /&gt;merge WORK.EMP_NAME(in=Emp_N)&lt;BR /&gt;WORK.EMP_DEPT(in=Emp_D);&lt;BR /&gt;by Empid;&lt;BR /&gt;if (Emp_N and not Emp_D) or (Emp_D and not Emp_N);&lt;/P&gt;&lt;P&gt;run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can somebody plz how i m getting 2 observations in work.all data set , how this if condition is selecting the data .&lt;/P&gt;</description>
    <pubDate>Sun, 01 Jul 2018 12:23:24 GMT</pubDate>
    <dc:creator>sanyam13</dc:creator>
    <dc:date>2018-07-01T12:23:24Z</dc:date>
    <item>
      <title>Merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging/m-p/474762#M122032</link>
      <description>&lt;P&gt;Name EmpID&lt;BR /&gt;---- -----&lt;BR /&gt;Jill 1864&lt;BR /&gt;Jack 2121&lt;BR /&gt;Joan 4698&lt;BR /&gt;John 5463&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Given the SAS data set WORK.EMP_DEPT:&lt;BR /&gt;EmpID Department&lt;BR /&gt;----- ----------&lt;BR /&gt;2121 Accounting&lt;BR /&gt;3567 Finance&lt;BR /&gt;4698 Marketing&lt;BR /&gt;5463 Accounting&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The following program is submitted:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data WORK.ALL;&lt;BR /&gt;merge WORK.EMP_NAME(in=Emp_N)&lt;BR /&gt;WORK.EMP_DEPT(in=Emp_D);&lt;BR /&gt;by Empid;&lt;BR /&gt;if (Emp_N and not Emp_D) or (Emp_D and not Emp_N);&lt;/P&gt;&lt;P&gt;run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can somebody plz how i m getting 2 observations in work.all data set , how this if condition is selecting the data .&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jul 2018 12:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging/m-p/474762#M122032</guid>
      <dc:creator>sanyam13</dc:creator>
      <dc:date>2018-07-01T12:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging/m-p/474764#M122034</link>
      <description>&lt;P&gt;The if (Emp_N and not Emp_D) gets the rows in the EMP_NAME data set that are not in the EMP_DEPT data set.&amp;nbsp; There's one: Jill.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The if (Emp_D and not Emp_N) gets the rows in the EMP_DEPT data set that are not in the EMP_NAME data set.&amp;nbsp; There's one:&amp;nbsp; The empID 3567 in Finance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The OR means that you want the rows that are in one data set but not the other, so you have 2 observations in the ALL data set.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jul 2018 14:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging/m-p/474764#M122034</guid>
      <dc:creator>SuzanneDorinski</dc:creator>
      <dc:date>2018-07-01T14:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging/m-p/474786#M122050</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12496"&gt;@SuzanneDorinski&lt;/a&gt;&amp;nbsp;already told you what happens.&lt;/P&gt;
&lt;P&gt;I just want to add some food for thought: a simpler form of the condition would be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if Emp_N ne Emp_D;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Jul 2018 18:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging/m-p/474786#M122050</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-01T18:42:47Z</dc:date>
    </item>
  </channel>
</rss>

