<?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: Count the same observations in two datasets in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Count-the-same-observations-in-two-datasets/m-p/619356#M19370</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202889"&gt;@dapenDaniel&lt;/a&gt;&amp;nbsp; That means one of the datasets has duplicate values of the same causing one to many join&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2020 22:55:12 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-01-22T22:55:12Z</dc:date>
    <item>
      <title>Count the same observations in two datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Count-the-same-observations-in-two-datasets/m-p/619354#M19369</link>
      <description>&lt;P&gt;Hi SAS Masters,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two dataset. Have1 has 293 observations and Have2 has 246 observations. Both of them only have one variable called "base". I am wondering how many of them are shown in both datasets. I have sorted these two datasets by base. The code I used is below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data common;
merge have1(in=h1) have2(in=h2);
by base;
if h1 and h2 then output common;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;however, the number of observations in "Common" is 258, which is more than the number of observations in Have2 (258 &amp;gt; 246). Did I use the wrong code? Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 22:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Count-the-same-observations-in-two-datasets/m-p/619354#M19369</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2020-01-22T22:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Count the same observations in two datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Count-the-same-observations-in-two-datasets/m-p/619356#M19370</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202889"&gt;@dapenDaniel&lt;/a&gt;&amp;nbsp; That means one of the datasets has duplicate values of the same causing one to many join&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 22:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Count-the-same-observations-in-two-datasets/m-p/619356#M19370</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-01-22T22:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Count the same observations in two datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Count-the-same-observations-in-two-datasets/m-p/619368#M19371</link>
      <description>&lt;P&gt;Consider this example to help you understand better&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input var;
cards;
1
2
3
;

data two;
input var;
cards;
1
1
2
2
2
3
;

data want;
 merge one two;
 by var;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jan 2020 23:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Count-the-same-observations-in-two-datasets/m-p/619368#M19371</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-01-22T23:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count the same observations in two datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Count-the-same-observations-in-two-datasets/m-p/619405#M19383</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 04:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Count-the-same-observations-in-two-datasets/m-p/619405#M19383</guid>
      <dc:creator>dapenDaniel</dc:creator>
      <dc:date>2020-01-23T04:31:10Z</dc:date>
    </item>
  </channel>
</rss>

