<?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: Help with count procedure. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-count-procedure/m-p/415796#M102041</link>
    <description>&lt;P&gt;Am not as familiar with proc freq as I should be, so I would do a small SQL:&lt;/P&gt;
&lt;PRE&gt;proc sql; 
  create table WANT as 
  select SHOP,
         count(distinct NAME) as PEOPLE
  from   HAVE
  group by SHOP;
quit;&lt;/PRE&gt;
&lt;P&gt;This will give you a table of all the shops, and the count of the people who used them.&amp;nbsp; You can proceed to sort this by PEOPLE to get the list from 20 downwards.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Nov 2017 11:21:58 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-11-23T11:21:58Z</dc:date>
    <item>
      <title>Help with count procedure.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-count-procedure/m-p/415794#M102039</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm struggling a little with a count problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset with just two variables, the variables are &lt;STRONG&gt;Name&lt;/STRONG&gt; and &lt;STRONG&gt;Shop &lt;/STRONG&gt;(both character)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;STRONG&gt;Name&lt;/STRONG&gt; variable contains a list of roughly 20 people.&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;Shop&lt;/STRONG&gt; variable contains a list of about 100000 shop names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What i'm trying to do is summarise the data (i've been trying to use proq freq) to show me the shop names where &lt;EM&gt;all &lt;/EM&gt;of the&amp;nbsp;people have used, so each of the 20 people have at some point been in that shop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I also want to do is a sliding scale so if there are no&amp;nbsp;shops that all 20 have used then show me the shops where at least 19 of them have been in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Appreciate any help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stret&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 11:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-count-procedure/m-p/415794#M102039</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2017-11-23T11:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with count procedure.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-count-procedure/m-p/415796#M102041</link>
      <description>&lt;P&gt;Am not as familiar with proc freq as I should be, so I would do a small SQL:&lt;/P&gt;
&lt;PRE&gt;proc sql; 
  create table WANT as 
  select SHOP,
         count(distinct NAME) as PEOPLE
  from   HAVE
  group by SHOP;
quit;&lt;/PRE&gt;
&lt;P&gt;This will give you a table of all the shops, and the count of the people who used them.&amp;nbsp; You can proceed to sort this by PEOPLE to get the list from 20 downwards.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 11:21:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-count-procedure/m-p/415796#M102041</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-23T11:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with count procedure.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-count-procedure/m-p/415797#M102042</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Am not as familiar with proc freq as I should be, so I would do a small SQL:&lt;/P&gt;
&lt;PRE&gt;proc sql; 
  create table WANT as 
  select SHOP,
         count(distinct NAME) as PEOPLE
  from   HAVE
  group by SHOP;
quit;&lt;/PRE&gt;
&lt;P&gt;This will give you a table of all the shops, and the count of the people who used them.&amp;nbsp; You can proceed to sort this by PEOPLE to get the list from 20 downwards.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Worked Perfectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Im not too good with Proc SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks you taking the time out.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 11:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-count-procedure/m-p/415797#M102042</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2017-11-23T11:26:53Z</dc:date>
    </item>
  </channel>
</rss>

