<?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: COUNTIF in SAS: counting how many cells in a row or column has value greater than a certain threshold in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177381#M45410</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Variable lists can also refer to all the variables in a range with the format FirstVar -- LastVar. To recycle &lt;A __default_attr="813022" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/" modifiedtitle="true" title="stat@sas "&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data have;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;input R T Y F N C P;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;cards;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1 2 3 2 2 3 2&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;2 3 4 2 3 2 3&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;3 3 4 3 5 2 4&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;4 3 4 5 2 2 2&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set have;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;array a{*} R -- P;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;values_gt_2=0;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;do _n_=1 to dim(a);&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if a{_n_}&amp;gt;2 then values_gt_2+1;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Oct 2014 00:31:45 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2014-10-09T00:31:45Z</dc:date>
    <item>
      <title>COUNTIF in SAS: counting how many cells in a row or column has value greater than a certain threshold</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177378#M45407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I achieve a similar countif function (excel) in SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset with several thousand columns (variables). For each observation (row), I want to count how many of those columns (variables) have a value greater than 0 (or some other threshold). How can I do this in SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similar, for each column, how can I count how many of the observations have a value that is greater than 0 (or some other threshold)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can do these easily in excel with countif function. But the data file is too big to be imported into excel.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 23:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177378#M45407</guid>
      <dc:creator>JC_HK</dc:creator>
      <dc:date>2014-10-08T23:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTIF in SAS: counting how many cells in a row or column has value greater than a certain threshold</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177379#M45408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input a1-a7;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 2 3 2 2 3 2&lt;/P&gt;&lt;P&gt;2 3 4 2 3 2 3&lt;/P&gt;&lt;P&gt;3 3 4 3 5 2 4&lt;/P&gt;&lt;P&gt;4 3 4 5 2 2 2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array a{*} a1-a7;&lt;/P&gt;&lt;P&gt;values_gt_2=0;&lt;/P&gt;&lt;P&gt;do _n_=1 to dim(a);&lt;/P&gt;&lt;P&gt;if a{_n_}&amp;gt;2 then values_gt_2+1;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 00:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177379#M45408</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-10-09T00:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTIF in SAS: counting how many cells in a row or column has value greater than a certain threshold</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177380#M45409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. The problem is that I have many variables in my dataset (in the scale of thousands) and they are not named after the convention of any sequential order (like a1-a1000).&amp;nbsp; Is there a easy way to rename it like the array form suggested? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 00:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177380#M45409</guid>
      <dc:creator>JC_HK</dc:creator>
      <dc:date>2014-10-09T00:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTIF in SAS: counting how many cells in a row or column has value greater than a certain threshold</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177381#M45410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Variable lists can also refer to all the variables in a range with the format FirstVar -- LastVar. To recycle &lt;A __default_attr="813022" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/" modifiedtitle="true" title="stat@sas "&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data have;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;input R T Y F N C P;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;cards;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1 2 3 2 2 3 2&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;2 3 4 2 3 2 3&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;3 3 4 3 5 2 4&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;4 3 4 5 2 2 2&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set have;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;array a{*} R -- P;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;values_gt_2=0;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;do _n_=1 to dim(a);&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if a{_n_}&amp;gt;2 then values_gt_2+1;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-size: 12.8000001907349px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 00:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177381#M45410</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-10-09T00:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTIF in SAS: counting how many cells in a row or column has value greater than a certain threshold</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177382#M45411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can modify above code in array statement. Just replaced variable names a1-a7 with &lt;STRONG&gt;_numeric_&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array a{*}&amp;nbsp; &lt;STRONG&gt;_numeric_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;values_gt_2=0;&lt;/P&gt;&lt;P&gt;do _n_=1 to dim(a);&lt;/P&gt;&lt;P&gt;if a{_n_}&amp;gt;2 then values_gt_2+1;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 00:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/COUNTIF-in-SAS-counting-how-many-cells-in-a-row-or-column-has/m-p/177382#M45411</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-10-09T00:35:20Z</dc:date>
    </item>
  </channel>
</rss>

