<?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: How to grab observations with particular count of any value of variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169415#M32507</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks it was just a syntax error of semicolumn &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Feb 2014 07:09:15 GMT</pubDate>
    <dc:creator>Sarvendra</dc:creator>
    <dc:date>2014-02-11T07:09:15Z</dc:date>
    <item>
      <title>How to grab observations with particular count of any value of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169409#M32501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I have a dataset with ACCNO&amp;nbsp; as a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;we need to grab all the observations with&amp;nbsp; ACCNOs with COUNT 3 or more .(or to create a new dataset with COUNT 3 or more)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I was thinking to implement this logic using first and last temporary variables but it was giving error.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;When it will read the first observation of any individual account number then initialize n=0 and increment each&amp;nbsp; iterating time and when it will read last observation of any individual account then if value of n greator than or equal to 3 the it should&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Create a new dataset satisfying this condition.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Can there be any better&amp;nbsp; logic for this .as below logic not working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data ssingh.FINADVNEWariable&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set ssingh.FINADV&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;by ACCNO;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if first.ACCNO then n = 0;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;n + 1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if last.ACCNO and n gt 3 then output ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Please reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 17:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169409#M32501</guid>
      <dc:creator>Sarvendra</dc:creator>
      <dc:date>2014-02-10T17:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to grab observations with particular count of any value of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169410#M32502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A Proc SQL step works nicely (untested)&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;select * from&lt;/P&gt;&lt;P&gt;have where accno in (select accno from have group by accno having count(accno)&amp;gt;3);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 19:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169410#M32502</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-02-10T19:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to grab observations with particular count of any value of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169411#M32503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code has syntax errors. You are missing semicolons on the first two lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;data ssingh.FINADVNEWariable&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;set ssingh.FINADV&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Otherwise your code should work as long as the dataset on the SET statement is sorted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 19:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169411#M32503</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2014-02-10T19:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to grab observations with particular count of any value of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169412#M32504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to be a duplication of &lt;A _jive_internal="true" href="https://communities.sas.com/message/196596#196596"&gt;https://communities.sas.com/message/196596#196596&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 19:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169412#M32504</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2014-02-10T19:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to grab observations with particular count of any value of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169413#M32505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps a smaller issue ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your original post asks for count greater than or equal to 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt means "greater than"&lt;/P&gt;&lt;P&gt;ge means "greater than or equal"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 19:19:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169413#M32505</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-02-10T19:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to grab observations with particular count of any value of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169414#M32506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Reeza its working absolutely fine. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 07:08:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169414#M32506</guid>
      <dc:creator>Sarvendra</dc:creator>
      <dc:date>2014-02-11T07:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to grab observations with particular count of any value of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169415#M32507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks it was just a syntax error of semicolumn &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 07:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-grab-observations-with-particular-count-of-any-value-of/m-p/169415#M32507</guid>
      <dc:creator>Sarvendra</dc:creator>
      <dc:date>2014-02-11T07:09:15Z</dc:date>
    </item>
  </channel>
</rss>

