<?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: Countw T vs M modifier or please recommend the appropriate modifier? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574582#M162388</link>
    <description>If you switch from COUNTW to COUNT, it's easy to count the number of commas.</description>
    <pubDate>Thu, 18 Jul 2019 14:12:46 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-07-18T14:12:46Z</dc:date>
    <item>
      <title>Countw T vs M modifier or please recommend the appropriate modifier?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574565#M162378</link>
      <description>&lt;P&gt;Countw T vs M modifier or please recommend the appropriate modifier other than B to make it count from left to right for the below scenario? My eyes are failing to spot and catch the modifier&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The expected count is 6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
count=countw('a, b, c,,d, e,     ',   ','   );
put count=;/*this is not counting embedded one but is counting the trailing*/

count=countw('a, b, c,,d, e,     ',   ','   ,'t');
put count=;

count=countw('a, b, c,,d, e,     ',   ','   ,'m');
put count=;

count=countw('a, b, c,,d, e,     ',   ','   ,'b');
put count=;
run;&lt;/CODE&gt;&lt;/PRE&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>Thu, 18 Jul 2019 13:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574565#M162378</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-07-18T13:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Countw T vs M modifier or please recommend the appropriate modifier?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574567#M162380</link>
      <description>&lt;P&gt;Use the M modifier to allow it to count the adjacent delimiters as indicating null values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are 7 words in your string, the last one is all blanks.&amp;nbsp; If you want a result of 6 then subtract 1 from the normal result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 13:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574567#M162380</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-18T13:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Countw T vs M modifier or please recommend the appropriate modifier?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574572#M162381</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp; &amp;nbsp;So no modifier available to exclude the trailing and yet count the consecutive&amp;nbsp; ?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 13:54:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574572#M162381</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-07-18T13:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Countw T vs M modifier or please recommend the appropriate modifier?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574573#M162382</link>
      <description>&lt;P&gt;Why would you want to exclude data?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 13:55:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574573#M162382</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-18T13:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Countw T vs M modifier or please recommend the appropriate modifier?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574576#M162385</link>
      <description>&lt;P&gt;I agree to count with M and then minus is neat. But I just wanted to see/learn if there is a straight forward way(without having to manipulate&amp;nbsp; ) to count from left to right with options only till the last delim. Hypothetically assuming the requirement is to count the number of words until the last delim.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 14:00:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574576#M162385</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-07-18T14:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Countw T vs M modifier or please recommend the appropriate modifier?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574582#M162388</link>
      <description>If you switch from COUNTW to COUNT, it's easy to count the number of commas.</description>
      <pubDate>Thu, 18 Jul 2019 14:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574582#M162388</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-07-18T14:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Countw T vs M modifier or please recommend the appropriate modifier?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574584#M162390</link>
      <description>&lt;P&gt;Slick idea:)&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 14:18:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574584#M162390</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-07-18T14:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Countw T vs M modifier or please recommend the appropriate modifier?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574585#M162391</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;If you switch from COUNTW to COUNT, it's easy to count the number of commas.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The problem with the COUNT() (or COUNTC()) function is that they do not offer the Q modifier to handle strings where the words contain the delimiter character.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 14:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Countw-T-vs-M-modifier-or-please-recommend-the-appropriate/m-p/574585#M162391</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-18T14:21:33Z</dc:date>
    </item>
  </channel>
</rss>

