<?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: any function can count blank? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630570#M186679</link>
    <description>&lt;P&gt;Character strings offer huge numbers of variations:&amp;nbsp; trailing blanks (that should presumably not be counted), multiple blanks between words (that presumably should be counted) to name a few.&amp;nbsp; I would try it differently:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   n_blanks = lengthn(var) - lengthn(compress(var));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Mar 2020 03:38:23 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2020-03-09T03:38:23Z</dc:date>
    <item>
      <title>any function can count blank?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630555#M186673</link>
      <description>&lt;P&gt;good day&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is there any&amp;nbsp;function can count the blank from name string&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="375"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="375"&gt;FACEBK AABMSW FBMEADS IRL&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;like there are 3 blanks over the name string&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 also do some data cleansing on this record and the result is FACEBKAAB&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can i using that cleansing result and&amp;nbsp; scan/crosscheck the original record and show below result?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;because i did the compress on my cleaned record and i wanted to keep that blank in this attempt of crosscheck&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FACEBK AAB&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so that i can know how well is my cleansing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 02:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630555#M186673</guid>
      <dc:creator>harrylui</dc:creator>
      <dc:date>2020-03-09T02:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: any function can count blank?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630558#M186674</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data w;
str='FACEBK AABMSW FBMEADS IRL';
count=countc(str,' ');
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;/*Or you could use S modifier in the same COUNTC function*/&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
str='FACEBK AABMSW FBMEADS IRL kjh';
count=countc(str,,'s');
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 02:58:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630558#M186674</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-09T02:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: any function can count blank?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630567#M186677</link>
      <description>Some other functions you may find useful, include COUNTC(), SCAN(), TRANSLATE() and COUNTW() which will count the number of words. You can use COUNTW() to find the number of words, and then loop with SCAN() to isolate each word if you want.</description>
      <pubDate>Mon, 09 Mar 2020 03:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630567#M186677</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-09T03:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: any function can count blank?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630570#M186679</link>
      <description>&lt;P&gt;Character strings offer huge numbers of variations:&amp;nbsp; trailing blanks (that should presumably not be counted), multiple blanks between words (that presumably should be counted) to name a few.&amp;nbsp; I would try it differently:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   n_blanks = lengthn(var) - lengthn(compress(var));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2020 03:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630570#M186679</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-03-09T03:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: any function can count blank?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630596#M186688</link>
      <description>&lt;P&gt;thank you all for helping&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 08:56:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/any-function-can-count-blank/m-p/630596#M186688</guid>
      <dc:creator>harrylui</dc:creator>
      <dc:date>2020-03-09T08:56:16Z</dc:date>
    </item>
  </channel>
</rss>

