<?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 After merging, why does one file consist of all observations and increase in size? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200660#M4399</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe the title is too vague, but here's the actual circumstance. Before merging, I have file number 1 with the size of N1 and file number 2 N2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the most part, N2 is a subset of N1. Some observations in N2 may not be in N1 as seen later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After merging, the size becomes N, N &amp;gt; N1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run a crosstab of index variables, it indicates that all observations in N come from file number 1. How can that be possible when N &amp;gt; N1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Apr 2015 05:43:09 GMT</pubDate>
    <dc:creator>NonSleeper</dc:creator>
    <dc:date>2015-04-21T05:43:09Z</dc:date>
    <item>
      <title>After merging, why does one file consist of all observations and increase in size?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200660#M4399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe the title is too vague, but here's the actual circumstance. Before merging, I have file number 1 with the size of N1 and file number 2 N2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the most part, N2 is a subset of N1. Some observations in N2 may not be in N1 as seen later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After merging, the size becomes N, N &amp;gt; N1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run a crosstab of index variables, it indicates that all observations in N come from file number 1. How can that be possible when N &amp;gt; N1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 05:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200660#M4399</guid>
      <dc:creator>NonSleeper</dc:creator>
      <dc:date>2015-04-21T05:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: After merging, why does one file consist of all observations and increase in size?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200661#M4400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you do the merge? (Code)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 05:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200661#M4400</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-21T05:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: After merging, why does one file consist of all observations and increase in size?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200662#M4401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data merge;&lt;/P&gt;&lt;P&gt;merge file1 (in=x) file2 (in=y);&lt;/P&gt;&lt;P&gt;by ID;&lt;/P&gt;&lt;P&gt;index1=x;&lt;/P&gt;&lt;P&gt;index2=y;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=merge;&lt;/P&gt;&lt;P&gt;table index1*index2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 06:14:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200662#M4401</guid>
      <dc:creator>NonSleeper</dc:creator>
      <dc:date>2015-04-21T06:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: After merging, why does one file consist of all observations and increase in size?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200663#M4402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You did not set a condition in your merge like&lt;/P&gt;&lt;P&gt;if x and y;&lt;/P&gt;&lt;P&gt;So you get all the records from both tables.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;dataset file1&lt;/P&gt;&lt;P&gt;ID&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;&lt;/P&gt;&lt;P&gt;dataset file2&lt;/P&gt;&lt;P&gt;ID&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;&lt;/P&gt;&lt;P&gt;result&lt;/P&gt;&lt;P&gt;ID&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 06:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200663#M4402</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-21T06:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: After merging, why does one file consist of all observations and increase in size?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200664#M4403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But we can always filter out the observations after merging. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yet I think the problem here is that after merging, all observations were indicated to be from file 1; that is, in the crosstab, there were no cells where index1=0. That's OK if all observations in file 2 were subset of file 1, but then we expect that the sample size did not increase after merging, which however did increase (N &amp;gt; N1).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 06:58:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200664#M4403</guid>
      <dc:creator>NonSleeper</dc:creator>
      <dc:date>2015-04-21T06:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: After merging, why does one file consist of all observations and increase in size?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200665#M4404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If dataset 2 is a subset of dataset 1 in terms of the by variable, but has multiple observations for one or more ID's present in dataset 1, then those ID's will be multiplied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataset A&lt;/P&gt;&lt;P&gt;ID var1&lt;/P&gt;&lt;P&gt;1 x&lt;/P&gt;&lt;P&gt;2 y&lt;/P&gt;&lt;P&gt;3 z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataset B&lt;/P&gt;&lt;P&gt;ID var2&lt;/P&gt;&lt;P&gt;1 a&lt;/P&gt;&lt;P&gt;1 b&lt;/P&gt;&lt;P&gt;2 c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result:&lt;/P&gt;&lt;P&gt;ID var1 var2&lt;/P&gt;&lt;P&gt;1 x a&lt;/P&gt;&lt;P&gt;1 x b&lt;/P&gt;&lt;P&gt;2 y c&lt;/P&gt;&lt;P&gt;3 z&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 07:12:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200665#M4404</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-21T07:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: After merging, why does one file consist of all observations and increase in size?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200666#M4405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah ha, that's the right hit. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 07:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/After-merging-why-does-one-file-consist-of-all-observations-and/m-p/200666#M4405</guid>
      <dc:creator>NonSleeper</dc:creator>
      <dc:date>2015-04-21T07:21:52Z</dc:date>
    </item>
  </channel>
</rss>

