<?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 Counting Characters in an array of variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Counting-Characters-in-an-array-of-variables/m-p/718333#M222298</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a set of variables (diagnostic codes 1-10) that I need combine them in one&amp;nbsp;new variable (DC_F) and then:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1- Substring the first letter&amp;nbsp; in the 10 variables (eg F111-&amp;gt; F)&lt;/P&gt;&lt;P&gt;2- Count the number of Fs in each variable and sum them in (DC_F)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already created an array and searched some codes:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
set have;&amp;nbsp;

Array DIAGNOSTIC_CODES Diag_code_1-Diag_code_10 ;
Do i= 1 to 10;

if DIAGNOSTIC_CODES[i] in("T***") then T***=1 ;
end;&amp;nbsp;

run;





&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Feb 2021 17:55:19 GMT</pubDate>
    <dc:creator>mariamabotaleb</dc:creator>
    <dc:date>2021-02-10T17:55:19Z</dc:date>
    <item>
      <title>Counting Characters in an array of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-Characters-in-an-array-of-variables/m-p/718333#M222298</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a set of variables (diagnostic codes 1-10) that I need combine them in one&amp;nbsp;new variable (DC_F) and then:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1- Substring the first letter&amp;nbsp; in the 10 variables (eg F111-&amp;gt; F)&lt;/P&gt;&lt;P&gt;2- Count the number of Fs in each variable and sum them in (DC_F)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already created an array and searched some codes:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
set have;&amp;nbsp;

Array DIAGNOSTIC_CODES Diag_code_1-Diag_code_10 ;
Do i= 1 to 10;

if DIAGNOSTIC_CODES[i] in("T***") then T***=1 ;
end;&amp;nbsp;

run;





&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 17:55:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-Characters-in-an-array-of-variables/m-p/718333#M222298</guid>
      <dc:creator>mariamabotaleb</dc:creator>
      <dc:date>2021-02-10T17:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Characters in an array of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-Characters-in-an-array-of-variables/m-p/718400#M222334</link>
      <description>&lt;P&gt;Is each observation supposed to have its own total number of "F"s?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is each variable supposed to have its own total number of "F"s?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is TC_F supposed to be a count for the entire data set, or a separate count for each observation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All of this is easy to do ... we just need to know what you want.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 20:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-Characters-in-an-array-of-variables/m-p/718400#M222334</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-02-10T20:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Characters in an array of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-Characters-in-an-array-of-variables/m-p/718404#M222338</link>
      <description>&lt;P&gt;Is each observation supposed to have its own total number of "F"s? &lt;FONT color="#ff0000"&gt;Yes&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is each variable supposed to have its own total number of "F"s? &lt;FONT color="#ff0000"&gt;Yes&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;I would like to have the sum of Fs in each observation and then the total number of F &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 21:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-Characters-in-an-array-of-variables/m-p/718404#M222338</guid>
      <dc:creator>mariamabotaleb</dc:creator>
      <dc:date>2021-02-10T21:10:49Z</dc:date>
    </item>
  </channel>
</rss>

