<?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 vowels from string and load in Macro variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Count-vowels-from-string-and-load-in-Macro-variables/m-p/329346#M73670</link>
    <description>&lt;P&gt;Edit: I add the i modifier also to avoid casing issues - even though your test data didn't show upper case.&lt;/P&gt;
&lt;P&gt;Use compress with the keep option and lengthn:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  num_vowels=lengthn(compress(yourvariable,"aeiou","ki"));
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2017 10:08:27 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-02-02T10:08:27Z</dc:date>
    <item>
      <title>Count vowels from string and load in Macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-vowels-from-string-and-load-in-Macro-variables/m-p/329343#M73668</link>
      <description>&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;var1 var2&lt;/P&gt;&lt;P&gt;1 read&lt;/P&gt;&lt;P&gt;2 write&lt;/P&gt;&lt;P&gt;3 sing&lt;/P&gt;&lt;P&gt;4 dance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to load count of vowels from var2 to macro variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like for read - 2 vowels (o and e)&lt;/P&gt;&lt;P&gt;write - 2 (i and e)&lt;/P&gt;&lt;P&gt;goes on...&lt;/P&gt;&lt;P&gt;help me how to count vowels from a string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 09:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-vowels-from-string-and-load-in-Macro-variables/m-p/329343#M73668</guid>
      <dc:creator>vandhan</dc:creator>
      <dc:date>2017-02-02T09:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count vowels from string and load in Macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-vowels-from-string-and-load-in-Macro-variables/m-p/329346#M73670</link>
      <description>&lt;P&gt;Edit: I add the i modifier also to avoid casing issues - even though your test data didn't show upper case.&lt;/P&gt;
&lt;P&gt;Use compress with the keep option and lengthn:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  num_vowels=lengthn(compress(yourvariable,"aeiou","ki"));
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 10:08:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-vowels-from-string-and-load-in-Macro-variables/m-p/329346#M73670</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-02-02T10:08:27Z</dc:date>
    </item>
  </channel>
</rss>

