<?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 Count the number of individuals. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Count-the-number-of-individuals/m-p/146599#M29147</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have one table A with one variable ID ( for identity ) and another table B, with variables ID, CITY, VAR3, VAR4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In table A each ID occurs only once.&lt;/P&gt;&lt;P&gt;In table B each ID can have more then one record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the number of ID:s in each CITY. An ID should be counted in each city it occurs, so the total number could be more than the number of individuals in table A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result should be presented in a table C, with variables CITY and N, where N = number of individuals in each city.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think there is no need to use table A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any suggestions how to solve this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 May 2014 13:07:48 GMT</pubDate>
    <dc:creator>attjooo</dc:creator>
    <dc:date>2014-05-06T13:07:48Z</dc:date>
    <item>
      <title>Count the number of individuals.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-number-of-individuals/m-p/146599#M29147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have one table A with one variable ID ( for identity ) and another table B, with variables ID, CITY, VAR3, VAR4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In table A each ID occurs only once.&lt;/P&gt;&lt;P&gt;In table B each ID can have more then one record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the number of ID:s in each CITY. An ID should be counted in each city it occurs, so the total number could be more than the number of individuals in table A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result should be presented in a table C, with variables CITY and N, where N = number of individuals in each city.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think there is no need to use table A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any suggestions how to solve this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 13:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-number-of-individuals/m-p/146599#M29147</guid>
      <dc:creator>attjooo</dc:creator>
      <dc:date>2014-05-06T13:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of individuals.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-number-of-individuals/m-p/146600#M29148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.city,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(distinct a.id) as Distinct_IDs&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on a.id=b.id&lt;/P&gt;&lt;P&gt;group by b.city;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 13:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-number-of-individuals/m-p/146600#M29148</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-05-06T13:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of individuals.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-number-of-individuals/m-p/146601#M29149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, you wouldn't need A as it doesn't add anything.&amp;nbsp; Try:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table C as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distinct CITY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(ID) as N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by CITY;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 13:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-number-of-individuals/m-p/146601#M29149</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-06T13:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of individuals.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-number-of-individuals/m-p/146602#M29150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;true...unless there may be IDs in table B that you don't want counted...or if you needed other attributes on table A that weren't included in B....(assumes facts not in evidence).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 13:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-number-of-individuals/m-p/146602#M29150</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-05-06T13:33:19Z</dc:date>
    </item>
  </channel>
</rss>

