<?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 obs Horizontally in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Counting-obs-Horizontally/m-p/35528#M8780</link>
    <description>Using a DATA step and two arrays (one to track the values and another to track the counts), you can loop through each observation's variable "values" for A through E identifying each unique instance and incrementing a counter.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Fri, 22 May 2009 12:07:54 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-05-22T12:07:54Z</dc:date>
    <item>
      <title>Counting obs Horizontally</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-obs-Horizontally/m-p/35527#M8779</link>
      <description>Hi i have 5 variable i want the count of most observation occured&lt;BR /&gt;
&lt;BR /&gt;
a b c d e  most_obs  count&lt;BR /&gt;
1 1 1 2 3     1          3&lt;BR /&gt;
5 5 6 5 2     5         2&lt;BR /&gt;
9 9 2 0 8     2         9&lt;BR /&gt;
&lt;BR /&gt;
in this first observation the mostly repedatd observation was 1 so the variable as most_obs as 1 and the  count was 3 .like this i have 20,000 obs</description>
      <pubDate>Fri, 22 May 2009 06:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-obs-Horizontally/m-p/35527#M8779</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-22T06:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Counting obs Horizontally</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-obs-Horizontally/m-p/35528#M8780</link>
      <description>Using a DATA step and two arrays (one to track the values and another to track the counts), you can loop through each observation's variable "values" for A through E identifying each unique instance and incrementing a counter.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 22 May 2009 12:07:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-obs-Horizontally/m-p/35528#M8780</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-22T12:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Counting obs Horizontally</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-obs-Horizontally/m-p/35529#M8781</link>
      <description>might also find CALL SORTc/n() useful, to put the array values into order. Then as you go through the array of values, you only need to keep the latest value, it's counter and the highest value/count so far. It scales up better, and you won't need to search for the counter to update as you look at each (disordered) array value.&lt;BR /&gt;
 &lt;BR /&gt;
Peter</description>
      <pubDate>Fri, 22 May 2009 14:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-obs-Horizontally/m-p/35529#M8781</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-05-22T14:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Counting obs Horizontally</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-obs-Horizontally/m-p/35530#M8782</link>
      <description>A SAS pre-processing SORT step gets the data into order, followed by the DATA step suggested.  The use of two ARRAYs (in parallel, one for value and another for count) addresses the objective, using the DO I=1 TO DIM(&lt;ARRAYNAME&gt;); / END; with the "I" variable paralleling the two arrays.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/ARRAYNAME&gt;</description>
      <pubDate>Fri, 22 May 2009 16:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-obs-Horizontally/m-p/35530#M8782</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-22T16:45:35Z</dc:date>
    </item>
  </channel>
</rss>

