<?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: About countw in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/About-countw/m-p/677669#M204435</link>
    <description>&lt;P&gt;There are 4 words in the text string - 'US' counts as a word too. COUNTW counts words.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Aug 2020 01:07:55 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-08-19T01:07:55Z</dc:date>
    <item>
      <title>About countw</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-countw/m-p/677645#M204432</link>
      <description>&lt;P&gt;For this question, I cannot make sense the answer for wordnum. I think it should be 3. Can you please help me to figure it out? Thanks so much&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jianan_luna_0-1597784869379.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48399iC460A4099C680059/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jianan_luna_0-1597784869379.png" alt="Jianan_luna_0-1597784869379.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 21:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-countw/m-p/677645#M204432</guid>
      <dc:creator>Jianan_luna</dc:creator>
      <dc:date>2020-08-18T21:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: About countw</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-countw/m-p/677669#M204435</link>
      <description>&lt;P&gt;There are 4 words in the text string - 'US' counts as a word too. COUNTW counts words.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 01:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-countw/m-p/677669#M204435</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-08-19T01:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: About countw</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-countw/m-p/677673#M204439</link>
      <description>&lt;P&gt;COUNTW without any modifiers and just the string will count everything separated by the default list of delimiters as a word. Since comma and space are some of the default delimiters when you do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Countw('Australia, Italy, Austria, US') then the first word is Australia, second is Italy, third is Austria and 4th is US.&lt;/P&gt;
&lt;P&gt;In this code:&lt;/P&gt;
&lt;PRE&gt;data example;
   x ='123,ABC, six, B, Pdq, {, #';
   count = countw(x);
   put count=;
run;&lt;/PRE&gt;
&lt;P&gt;The result is 7 because &lt;STRONG&gt;anything&lt;/STRONG&gt; delimited by comma and space counts as a "word" even the single characters { and # unless you modify the list of delimiters.&lt;/P&gt;
&lt;P&gt;In this&lt;/P&gt;
&lt;PRE&gt;data example;
   x ='123,ABC, six, B, Pdq, {, #';
   count = countw(x,'B');
   put count=;
run;&lt;/PRE&gt;
&lt;P&gt;the 'B' in the countw function modifies the list of delimiters and in this case will use &lt;STRONG&gt;only&lt;/STRONG&gt; the letter B as a delimiter. So the "words" become : "123,A"&amp;nbsp;&amp;nbsp; "C, six, " and&amp;nbsp; ", Pdq, {, #".&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 01:49:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-countw/m-p/677673#M204439</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-19T01:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: About countw</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-countw/m-p/677918#M204557</link>
      <description>Thanks so much, for the second example, the value of count is 3, right?</description>
      <pubDate>Wed, 19 Aug 2020 23:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-countw/m-p/677918#M204557</guid>
      <dc:creator>Jianan_luna</dc:creator>
      <dc:date>2020-08-19T23:08:05Z</dc:date>
    </item>
  </channel>
</rss>

