<?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 of variable with condition in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/count-of-variable-with-condition/m-p/255437#M6955</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set which looks like in the attached file, and I need the output file as in the attached (other small table). I have tries using many ways but could not get the expected output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2016 04:26:42 GMT</pubDate>
    <dc:creator>don21</dc:creator>
    <dc:date>2016-03-09T04:26:42Z</dc:date>
    <item>
      <title>count of variable with condition</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/count-of-variable-with-condition/m-p/255437#M6955</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set which looks like in the attached file, and I need the output file as in the attached (other small table). I have tries using many ways but could not get the expected output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2016 04:26:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/count-of-variable-with-condition/m-p/255437#M6955</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-09T04:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: count of variable with condition</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/count-of-variable-with-condition/m-p/255439#M6956</link>
      <description>&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
by manager date;
run;

data want;
set have;
by manager date;
retain count tot;
if first.date then do;
count=1;
tot=total;
end;
else do;
count=count+1;
tot=tot+total;
end;
if last.date;
drop staff total;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;alternatively by proc sql&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as select manager, date, count(staff) as count, sum(total) as tot from have
group by manager,date;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Mar 2016 05:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/count-of-variable-with-condition/m-p/255439#M6956</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-03-09T05:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: count of variable with condition</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/count-of-variable-with-condition/m-p/255441#M6957</link>
      <description>Thank you so much Jagadish.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 09 Mar 2016 06:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/count-of-variable-with-condition/m-p/255441#M6957</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-09T06:34:27Z</dc:date>
    </item>
  </channel>
</rss>

