<?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 counting number of registers that are greater than 1, 2, 3.... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480366#M286600</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with just one column with hundreds of numbers:&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;and I want a table with the information of number of registers greater than 1, greater than 2, greater than 3 ann so on, until 48, without having to repeat 48 times select count(*) from table where column&amp;gt;n, where n is 1, 2, 3....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jul 2018 09:06:51 GMT</pubDate>
    <dc:creator>ariogon</dc:creator>
    <dc:date>2018-07-23T09:06:51Z</dc:date>
    <item>
      <title>counting number of registers that are greater than 1, 2, 3....</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480366#M286600</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with just one column with hundreds of numbers:&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;and I want a table with the information of number of registers greater than 1, greater than 2, greater than 3 ann so on, until 48, without having to repeat 48 times select count(*) from table where column&amp;gt;n, where n is 1, 2, 3....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 09:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480366#M286600</guid>
      <dc:creator>ariogon</dc:creator>
      <dc:date>2018-07-23T09:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: counting number of registers that are greater than 1, 2, 3....</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480372#M286601</link>
      <description>&lt;P&gt;Post test data in the form of a datastep, and show what the output should look like.&amp;nbsp; At a guess:&lt;/P&gt;
&lt;PRE&gt;data have;
  input num;
datalines;
1
2
7
2
8
6
7
;
run;

data want;
  set have;
  array res{48} 8;
  retain res:;
  do i=1 to 48;
    if num &amp;gt;= i then res{i}=sum(res{i},1);
  end;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Jul 2018 09:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480372#M286601</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-23T09:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: counting number of registers that are greater than 1, 2, 3....</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480387#M286602</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input num;
datalines;
1
2
7
2
8
6
7
;
run;

proc sort data=have out=temp;
   by num;
run;

data want;
   set temp;
   by num;
   sum+1;
   if last.num &amp;amp; num le 48;
   retain sum;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Jul 2018 10:50:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480387#M286602</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-23T10:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: counting number of registers that are greater than 1, 2, 3....</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480414#M286603</link>
      <description>&lt;P&gt;The output for the data of the example should be a table of 2 columns:&lt;/P&gt;&lt;P&gt;1 6&lt;/P&gt;&lt;P&gt;2 4&lt;/P&gt;&lt;P&gt;3 4&lt;/P&gt;&lt;P&gt;4 4&lt;/P&gt;&lt;P&gt;5 4&lt;/P&gt;&lt;P&gt;6 3&lt;/P&gt;&lt;P&gt;7 1&lt;/P&gt;&lt;P&gt;8 0&lt;/P&gt;&lt;P&gt;9 0&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;48 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480414#M286603</guid>
      <dc:creator>ariogon</dc:creator>
      <dc:date>2018-07-23T13:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: counting number of registers that are greater than 1, 2, 3....</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480545#M286604</link>
      <description>&lt;P&gt;And another approach:&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table want as
   select num , count(num) as Numcount
   from have
   group by num;
quit;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Jul 2018 17:25:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-number-of-registers-that-are-greater-than-1-2-3/m-p/480545#M286604</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-23T17:25:41Z</dc:date>
    </item>
  </channel>
</rss>

