<?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 occurrence of a variable across columns per observation in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/893205#M11084</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439052"&gt;@SAS_SB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am having a similar situation where I need to count another value as well. In the example you have, I would like to count either 1 or 9, which would be 5 instead of 4 in the variable "want".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would appreciate it if you could help me on this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Re-read the marked answer as that case was already covered.&amp;nbsp; Instead of passing the one character string '1' to the COUNTC() function you want to pass the two character string '19'.&lt;/P&gt;
&lt;P&gt;For the array based solutions instead of test if the value is equal to 1 you can test if the value is in the list 1 9.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2023 18:59:04 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-09-07T18:59:04Z</dc:date>
    <item>
      <title>Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709718#M9634</link>
      <description>&lt;P&gt;I am new to SAS so forgive me if this is basic. I have a data set with 150,000+ rows, each with a unique ID, and 250 columns, all columns must be retained. However for this specific inquiry, I am only interested in 13 columns; each column is a variable with a valueof&amp;nbsp; "0" "1" "7" or "9". &amp;nbsp;I would like to make a new column that counts the number of times a "1" populates a column cell across the row/observation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&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;count of "1"&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Col1&amp;nbsp; &amp;nbsp; Col2&amp;nbsp; &amp;nbsp; &amp;nbsp;Col3&amp;nbsp; &amp;nbsp; Col4&amp;nbsp; &amp;nbsp; Col5&amp;nbsp; &amp;nbsp; &amp;nbsp;Col6&amp;nbsp; &amp;nbsp; &amp;nbsp; Col7&amp;nbsp; &amp;nbsp; Col8................&lt;STRONG&gt;WANT&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;152&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/P&gt;&lt;P&gt;153&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;154&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;155&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/P&gt;&lt;P&gt;156&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;157&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried solutions from other forums with similar problems haven't found anything that has worked for me. I appreciate the help!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 21:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709718#M9634</guid>
      <dc:creator>kirkends</dc:creator>
      <dc:date>2021-01-06T21:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709724#M9635</link>
      <description>&lt;P&gt;This looks like a classic application of the array statement, followed by a loop over that array, as in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  array testvals  col1 col2 ... col8 .. ;
  do over testvals;
    want=sum(want,testvals in (0,1,7,9));
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The ARRAY statement names an array whose elements are col1 col2 ... col8 ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the DO OVER arrayname loops over those elements.&amp;nbsp; The "testvals in (0,1,7,9) returns a 1 or 0 depending no whether the IN condition is satisfied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The more modern use of array in sas wold use array names with subscripts:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  array testvals {*} col1 col2 ... col8 .. ;
  do i=1 to dim(testvals);
    want=sum(want,testvals{i} in (0,1,7,9));
  end;
  drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But for this task, I like the old way - no need to create, and then drop the i variable.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 21:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709724#M9635</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-01-06T21:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709725#M9636</link>
      <description>&lt;P&gt;BTW, you are counting the occurrence of a &lt;EM&gt;&lt;STRONG&gt;value&lt;/STRONG&gt;&lt;/EM&gt; across columns, not occurrence of a &lt;EM&gt;&lt;STRONG&gt;variable&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 21:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709725#M9636</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-01-06T21:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709726#M9637</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID         Col1    Col2     Col3    Col4    Col5     Col6      Col7    Col8;*................WANT ;
cards;
152         1           0          1          0         1           9          1          7                        4

153         0           0          7          7         1           9          0          9                        1

154         1           9          1          9         9           0          0          9                        2

155         7           1          9          1         9           1          1          9                        4

156         9           0          0          9         0           0          0          0                        0

157         9           7          9          0         7           1          0          0                        1
;

data want;
 set have;
 want=countc(cats(of col1-col8),'1');
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jan 2021 21:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709726#M9637</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-01-06T21:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709750#M9638</link>
      <description>&lt;P&gt;A "variable" only occurs once per observation. So no need to count.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A VALUE on the other hand is a different matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are your variables actually numeric or character? This would work for either though if the variables ar&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   countval = countc(cats(of col1-col13),'1');
run;&lt;/PRE&gt;
&lt;P&gt;If your actual variables are not consecutively numbered then list them instead of the "of col1 - col13" I used above: countc (cats(col1,col4,col11,&amp;lt;finish the list&amp;gt;),'1');&lt;/P&gt;
&lt;P&gt;The countc function counts characters, so would not work if you have values like 11 (which would be two 1's), the Cats function concatenates all of the variables into a single string that countc wants as the "search" string. The second parameter for the countc function is the specific characters to search for. So if you place '79' in the second position you would get count of 7 and 9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would I be correct guessing that you have survey data with question answers of Yes (1) , No(0), Don't know(7) and Refused (9) ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 22:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709750#M9638</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-06T22:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709767#M9639</link>
      <description>&lt;BR /&gt;This is exactly what I was looking for. Sorry about the term mix up I am still learning! This does explains why me searches were fruitless.... I am working on Survey Data and 1=yes, 0=No, 7=unknown, 9=missing, I just converted characters to numerics for ease of uses in other inquiries.&lt;BR /&gt;&lt;BR /&gt;Thank you</description>
      <pubDate>Wed, 06 Jan 2021 22:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709767#M9639</guid>
      <dc:creator>kirkends</dc:creator>
      <dc:date>2021-01-06T22:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709769#M9640</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/348764"&gt;@kirkends&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;This is exactly what I was looking for. Sorry about the term mix up I am still learning! This does explains why me searches were fruitless.... I am working on Survey Data and 1=yes, 0=No, 7=unknown, 9=missing, I just converted characters to numerics for ease of uses in other inquiries.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is absolutely no reason to apologize for converting the codes. I would myself. And could very well create re-coded variables setting the 7 and 9 to missing to report on prevalence among respondents that answered the question yes or no.&lt;/P&gt;
&lt;P&gt;Arrays are a perfect approach to do that.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 23:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/709769#M9640</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-06T23:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/893201#M11083</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am having a similar situation where I need to count another value as well. In the example you have, I would like to count either 1 or 9, which would be 5 instead of 4 in the variable "want".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would appreciate it if you could help me on this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 18:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/893201#M11083</guid>
      <dc:creator>SAS_SB</dc:creator>
      <dc:date>2023-09-07T18:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/893205#M11084</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439052"&gt;@SAS_SB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am having a similar situation where I need to count another value as well. In the example you have, I would like to count either 1 or 9, which would be 5 instead of 4 in the variable "want".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would appreciate it if you could help me on this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Re-read the marked answer as that case was already covered.&amp;nbsp; Instead of passing the one character string '1' to the COUNTC() function you want to pass the two character string '19'.&lt;/P&gt;
&lt;P&gt;For the array based solutions instead of test if the value is equal to 1 you can test if the value is in the list 1 9.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 18:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/893205#M11084</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-07T18:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the occurrence of a variable across columns per observation</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/893321#M11085</link>
      <description>&lt;P&gt;Got it, thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 14:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Counting-the-occurrence-of-a-variable-across-columns-per/m-p/893321#M11085</guid>
      <dc:creator>SAS_SB</dc:creator>
      <dc:date>2023-09-08T14:46:38Z</dc:date>
    </item>
  </channel>
</rss>

