<?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 Count how many &amp;quot;$&amp;quot; in each record in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Count-how-many-quot-quot-in-each-record/m-p/736627#M229523</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a column named journey. Under journey there're rows, eg: abc$def$fgu. Now I want to count how many "$" in each record. In this case there will be three.&amp;nbsp; Any help is appreciated!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Apr 2021 16:54:11 GMT</pubDate>
    <dc:creator>yichentian226</dc:creator>
    <dc:date>2021-04-23T16:54:11Z</dc:date>
    <item>
      <title>Count how many "$" in each record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-how-many-quot-quot-in-each-record/m-p/736627#M229523</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a column named journey. Under journey there're rows, eg: abc$def$fgu. Now I want to count how many "$" in each record. In this case there will be three.&amp;nbsp; Any help is appreciated!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 16:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-how-many-quot-quot-in-each-record/m-p/736627#M229523</guid>
      <dc:creator>yichentian226</dc:creator>
      <dc:date>2021-04-23T16:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many "$" in each record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-how-many-quot-quot-in-each-record/m-p/736629#M229525</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/318223"&gt;@yichentian226&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a column named journey. Under journey there're rows, eg: abc$def$fgu. Now I want to count how many "$" in each record. In this case there will be three.&amp;nbsp; Any help is appreciated!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The SAS Countc function counts number of occurrences of a character in a variable:&lt;/P&gt;
&lt;PRE&gt;data example;
   journey="abc$def$fgu";
   dollarcount = countc(journey,"$");
run;&lt;/PRE&gt;
&lt;P&gt;Your example only shows 2 $ signs. eg: abc$def$fgu.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to count the number of things SEPARATED by the $&lt;/P&gt;
&lt;PRE&gt;data example2;
   journey="abc$def$fgu";
   dollarcount = countw(journey,"$");
run;&lt;/PRE&gt;
&lt;P&gt;Countw counts "words". The second parameter would be a list of characters used to separate the pieces of the value. This just uses the $ sign to separate.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 17:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-how-many-quot-quot-in-each-record/m-p/736629#M229525</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-23T17:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many "$" in each record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-how-many-quot-quot-in-each-record/m-p/736640#M229527</link>
      <description>THANKS SO MUCH! You rock!</description>
      <pubDate>Fri, 23 Apr 2021 18:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-how-many-quot-quot-in-each-record/m-p/736640#M229527</guid>
      <dc:creator>yichentian226</dc:creator>
      <dc:date>2021-04-23T18:13:58Z</dc:date>
    </item>
  </channel>
</rss>

