<?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 How to count the number of macro variables in use? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-the-number-of-macro-variables-in-use/m-p/587549#M167837</link>
    <description>&lt;P&gt;I'm defining a variable number of macro variables that I want to use later in my program.&lt;/P&gt;&lt;P&gt;The number of those user-defined macro variables will also be a parameter later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So let's say:&lt;/P&gt;&lt;PRE&gt;%let Opt1= 'abcd' 'efgd';
%let Opt2= 'abascd' 'efgretd';
%let Opt3= 'abgfcd' 'eqqwfgd';
%let Count_Opt=3; /* I don't want to do this manually. */&lt;/PRE&gt;&lt;P&gt;Is there a way to write those variables in a list and count this number then?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing I found was the&lt;/P&gt;&lt;PRE&gt;%put _user_;&lt;/PRE&gt;&lt;P&gt;statement to see all my defined variables but this writes to the log only. And even if I could manage to acces this list, I need to somehow just get that variables that start with "Opt".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way or do I have to stick to manually defining this number?&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2019 15:14:27 GMT</pubDate>
    <dc:creator>Emjay</dc:creator>
    <dc:date>2019-09-10T15:14:27Z</dc:date>
    <item>
      <title>How to count the number of macro variables in use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-the-number-of-macro-variables-in-use/m-p/587549#M167837</link>
      <description>&lt;P&gt;I'm defining a variable number of macro variables that I want to use later in my program.&lt;/P&gt;&lt;P&gt;The number of those user-defined macro variables will also be a parameter later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So let's say:&lt;/P&gt;&lt;PRE&gt;%let Opt1= 'abcd' 'efgd';
%let Opt2= 'abascd' 'efgretd';
%let Opt3= 'abgfcd' 'eqqwfgd';
%let Count_Opt=3; /* I don't want to do this manually. */&lt;/PRE&gt;&lt;P&gt;Is there a way to write those variables in a list and count this number then?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing I found was the&lt;/P&gt;&lt;PRE&gt;%put _user_;&lt;/PRE&gt;&lt;P&gt;statement to see all my defined variables but this writes to the log only. And even if I could manage to acces this list, I need to somehow just get that variables that start with "Opt".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way or do I have to stick to manually defining this number?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 15:14:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-the-number-of-macro-variables-in-use/m-p/587549#M167837</guid>
      <dc:creator>Emjay</dc:creator>
      <dc:date>2019-09-10T15:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of macro variables in use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-the-number-of-macro-variables-in-use/m-p/587552#M167838</link>
      <description>&lt;P&gt;THe list is in the Dictionary table, which you can access and count.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SASHELP.VMACRO is the name of the table.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 15:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-the-number-of-macro-variables-in-use/m-p/587552#M167838</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-10T15:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of macro variables in use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-the-number-of-macro-variables-in-use/m-p/587560#M167840</link>
      <description>&lt;P&gt;Wow, thanks for the quick help!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 15:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-the-number-of-macro-variables-in-use/m-p/587560#M167840</guid>
      <dc:creator>Emjay</dc:creator>
      <dc:date>2019-09-10T15:28:39Z</dc:date>
    </item>
  </channel>
</rss>

