<?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: Count with modifer in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759881#M240222</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data count;
name="Tokyo Olympics 2020          ";
x=count(name,'a');
x1=count(name,'a','i');
x2=count(name,'a','T');
xlength=length(x);
x1ength=length(x1);
x2length=length(x2);


run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;x2length&amp;nbsp; &amp;nbsp; result length is 12 even if I use letter 'a'&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Aug 2021 06:36:57 GMT</pubDate>
    <dc:creator>pavank</dc:creator>
    <dc:date>2021-08-06T06:36:57Z</dc:date>
    <item>
      <title>Count with modifer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759877#M240218</link>
      <description>&lt;P&gt;Hi Guys&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here count function modifier 't'&amp;nbsp; or 'T' doesn't trim trailing blanks where i was wrong please fix error&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data count;
name="Tokyo Olympics 2020          ";
x=count(name,'a');
x1=count(name,'a','i');
x2=count(name,'2','T');
xlength=length(x);
x1ength=length(x1);
x2length=length(x2);

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Aug 2021 06:17:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759877#M240218</guid>
      <dc:creator>pavank</dc:creator>
      <dc:date>2021-08-06T06:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count with modifer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759880#M240221</link>
      <description>&lt;P&gt;COUNT returns a number; using LENGTH on a number will cause that number to be converted to character using the BEST. format (IIRC, BEST12.).&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 06:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759880#M240221</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-06T06:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count with modifer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759881#M240222</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data count;
name="Tokyo Olympics 2020          ";
x=count(name,'a');
x1=count(name,'a','i');
x2=count(name,'a','T');
xlength=length(x);
x1ength=length(x1);
x2length=length(x2);


run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;x2length&amp;nbsp; &amp;nbsp; result length is 12 even if I use letter 'a'&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 06:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759881#M240222</guid>
      <dc:creator>pavank</dc:creator>
      <dc:date>2021-08-06T06:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Count with modifer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759883#M240223</link>
      <description>&lt;P&gt;I will just repeat what &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; already said:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;count returns a number&lt;/LI&gt;
&lt;LI&gt;using the function length on a number is not possible, so sas converts the number into a string (see the log: "Numeric values have been converted to character values")&lt;/LI&gt;
&lt;LI&gt;sas uses the format best12 to convert the number =&amp;gt; the string will always have the length of 12.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 06 Aug 2021 06:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759883#M240223</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-08-06T06:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Count with modifer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759886#M240226</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/390518"&gt;@pavank&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data count;
name="Tokyo Olympics 2020          ";
x=count(name,'a');
x1=count(name,'a','i');
x2=count(name,'a','T');
xlength=length(x);
x1ength=length(x1);
x2length=length(x2);


run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;x2length&amp;nbsp; &amp;nbsp; result length is 12 even if I use letter 'a'&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's because the BEST12. format results in a string with the number right-adjusted, and LENGTH counts all characters up to the&amp;nbsp;&lt;EM&gt;last non-blank&lt;/EM&gt; character, including&amp;nbsp;&lt;U&gt;all&lt;/U&gt; leading blanks.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 07:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-with-modifer/m-p/759886#M240226</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-06T07:32:58Z</dc:date>
    </item>
  </channel>
</rss>

