<?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: counting the observations in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/counting-the-observations/m-p/76880#M22289</link>
    <description>Or a bit easier:&lt;BR /&gt;
&lt;BR /&gt;
Proc sql;&lt;BR /&gt;
select id, count(*) as no&lt;BR /&gt;
from dsn&lt;BR /&gt;
group by id;&lt;BR /&gt;
/* or where id = 1 */&lt;BR /&gt;
quit;</description>
    <pubDate>Thu, 12 Mar 2009 11:47:55 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2009-03-12T11:47:55Z</dc:date>
    <item>
      <title>counting the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/counting-the-observations/m-p/76878#M22287</link>
      <description>data xl;&lt;BR /&gt;
input id sal;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 2&lt;BR /&gt;
2 1&lt;BR /&gt;
1 1&lt;BR /&gt;
2 2&lt;BR /&gt;
1 1&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
now i want the count of 1 in variable id.

Message was edited by: Michel_SAS</description>
      <pubDate>Thu, 12 Mar 2009 06:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/counting-the-observations/m-p/76878#M22287</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2009-03-12T06:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: counting the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/counting-the-observations/m-p/76879#M22288</link>
      <description>data dsn1;&lt;BR /&gt;
set dsn;&lt;BR /&gt;
by patid;&lt;BR /&gt;
cnt+1;&lt;BR /&gt;
if first.patid then cnt=1;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=dsn1;&lt;BR /&gt;
by patid descending cnt;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data dsn2;&lt;BR /&gt;
set dsn1;&lt;BR /&gt;
by patid;&lt;BR /&gt;
retain totcnt;&lt;BR /&gt;
if first.patid then totcnt=cnt;&lt;BR /&gt;
output;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print data=dsn2;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
or</description>
      <pubDate>Thu, 12 Mar 2009 09:44:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/counting-the-observations/m-p/76879#M22288</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2009-03-12T09:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: counting the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/counting-the-observations/m-p/76880#M22289</link>
      <description>Or a bit easier:&lt;BR /&gt;
&lt;BR /&gt;
Proc sql;&lt;BR /&gt;
select id, count(*) as no&lt;BR /&gt;
from dsn&lt;BR /&gt;
group by id;&lt;BR /&gt;
/* or where id = 1 */&lt;BR /&gt;
quit;</description>
      <pubDate>Thu, 12 Mar 2009 11:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/counting-the-observations/m-p/76880#M22289</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-03-12T11:47:55Z</dc:date>
    </item>
  </channel>
</rss>

