<?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: I have data set need to count column b values how many times it repeated in column a ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461293#M117329</link>
    <description>&lt;P&gt;Thanks everyone.... From next time I'll post questions in proper way... Sorry for the inconvenience.&lt;/P&gt;</description>
    <pubDate>Thu, 10 May 2018 11:36:13 GMT</pubDate>
    <dc:creator>rajeshalwayswel</dc:creator>
    <dc:date>2018-05-10T11:36:13Z</dc:date>
    <item>
      <title>I have data set need to count column b values how many times it repeated in column a ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461271#M117316</link>
      <description>I have data set need to count column b values how many times it repeated in column a data l; input a b; cards; 1 1 2 2 2 3 3 . 3 . 3 . 3 . run; Required output : a b 1 1 2 2 4 3</description>
      <pubDate>Thu, 10 May 2018 09:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461271#M117316</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2018-05-10T09:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: I have data set need to count column b values how many times it repeated in column a ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461273#M117318</link>
      <description>&lt;P&gt;Could you PLEASE post your code properly, like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data l;
input a b;
cards;
1 1
2 2
2 3
3 .
3 .
3 .
3 .
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It's not rocket science, really.&lt;/P&gt;
&lt;P&gt;Please state if the code above is what you intended.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 09:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461273#M117318</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-10T09:48:39Z</dc:date>
    </item>
    <item>
      <title>I have data set need to count column b values how many times it repeated in column a</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461274#M117325</link>
      <description>&lt;PRE&gt;I have data set need to count column b values how many times it repeated in column a 


data l;
input a b;
cards;
1 1
2 2
2 3
3 .
3 .
3 .
3 .
run;


output :


a b

1 1
2 2
4 3&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 May 2018 09:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461274#M117325</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2018-05-10T09:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: I have data set need to count column b values how many times it repeated in column a ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461275#M117320</link>
      <description>sure...</description>
      <pubDate>Thu, 10 May 2018 09:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461275#M117320</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2018-05-10T09:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: I have data set need to count column b values how many times it repeated in column a ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461278#M117321</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/174522"&gt;@rajeshalwayswel&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Assuming "sure...." means yes, that's how I intended to post my code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data l;
  input a b;
  cards;
1 1
2 2
2 3
3 .
3 .
3 .
3 .
;
run;

proc sql;
  create table want as
    select a, b, count(*) as cnt
      from l
        group by a,b
  ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 May 2018 10:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461278#M117321</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-05-10T10:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: I have data set need to count column b values how many times it repeated in column a</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461289#M117326</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/174522"&gt;@rajeshalwayswel&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;PRE&gt;I have data set need to count column b values how many times it repeated in column a 


data l;
input a b;
cards;
1 1
2 2
2 3
3 .
3 .
3 .
3 .
run;


output :


a b

1 1
2 2
4 3&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select count(*) as a, a as b
from l
group by a;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 May 2018 11:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461289#M117326</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-10T11:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: I have data set need to count column b values how many times it repeated in column a</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461290#M117327</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table final as&lt;BR /&gt;select a,&lt;BR /&gt;count(a) as COUNT&lt;BR /&gt;from l&lt;BR /&gt;group by a;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data ds;&lt;BR /&gt;set l;&lt;BR /&gt;by a b;&lt;BR /&gt;keep a count;&lt;BR /&gt;retain count 0;&lt;BR /&gt;if first.a=1 then count=1;&lt;BR /&gt;else count=sum(count,1);&lt;BR /&gt;if last.a=1 then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;srinath&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 11:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461290#M117327</guid>
      <dc:creator>srinath3111</dc:creator>
      <dc:date>2018-05-10T11:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: I have data set need to count column b values how many times it repeated in column a ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461292#M117328</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input a b;
cards;
1 1
2 2
2 3
3 .
3 .
3 .
3 .
run;

proc sql;
create table want as
select a,count(a) as b
from have
where a in (select b from have)
group by a;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 May 2018 11:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461292#M117328</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-10T11:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: I have data set need to count column b values how many times it repeated in column a ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461293#M117329</link>
      <description>&lt;P&gt;Thanks everyone.... From next time I'll post questions in proper way... Sorry for the inconvenience.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 11:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-have-data-set-need-to-count-column-b-values-how-many-times-it/m-p/461293#M117329</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2018-05-10T11:36:13Z</dc:date>
    </item>
  </channel>
</rss>

