<?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 Ordered Macro Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Ordered-Macro-Variables/m-p/43577#M8930</link>
    <description>Hello,&lt;BR /&gt;
I am trying to create multiple macro variables based on the number of rows in a dataset. Say if I have 3 rows in dataset sample like this - &lt;BR /&gt;
&lt;BR /&gt;
A     B&lt;BR /&gt;
NY   10&lt;BR /&gt;
NJ    5&lt;BR /&gt;
MD   7&lt;BR /&gt;
&lt;BR /&gt;
I need three macro variables &amp;amp;CNTNJ, &amp;amp;CNTNY &amp;amp;CNTMD to have 5, 10 and 7 respectively. Should I use 2 macros, the first to create a macro containing the string and the second to resolve it in a loop?&lt;BR /&gt;
&lt;BR /&gt;
Appreciate any suggestions.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
saspert</description>
    <pubDate>Mon, 04 Apr 2011 16:34:09 GMT</pubDate>
    <dc:creator>saspert</dc:creator>
    <dc:date>2011-04-04T16:34:09Z</dc:date>
    <item>
      <title>Ordered Macro Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ordered-Macro-Variables/m-p/43577#M8930</link>
      <description>Hello,&lt;BR /&gt;
I am trying to create multiple macro variables based on the number of rows in a dataset. Say if I have 3 rows in dataset sample like this - &lt;BR /&gt;
&lt;BR /&gt;
A     B&lt;BR /&gt;
NY   10&lt;BR /&gt;
NJ    5&lt;BR /&gt;
MD   7&lt;BR /&gt;
&lt;BR /&gt;
I need three macro variables &amp;amp;CNTNJ, &amp;amp;CNTNY &amp;amp;CNTMD to have 5, 10 and 7 respectively. Should I use 2 macros, the first to create a macro containing the string and the second to resolve it in a loop?&lt;BR /&gt;
&lt;BR /&gt;
Appreciate any suggestions.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
saspert</description>
      <pubDate>Mon, 04 Apr 2011 16:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ordered-Macro-Variables/m-p/43577#M8930</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-04-04T16:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Ordered Macro Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ordered-Macro-Variables/m-p/43578#M8931</link>
      <description>I would use something like:&lt;BR /&gt;
&lt;BR /&gt;
call symput(catx('CNT',A),B);&lt;BR /&gt;
&lt;BR /&gt;
in a data step.&lt;BR /&gt;
&lt;BR /&gt;
Good luck!</description>
      <pubDate>Mon, 04 Apr 2011 17:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ordered-Macro-Variables/m-p/43578#M8931</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2011-04-04T17:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Ordered Macro Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ordered-Macro-Variables/m-p/43579#M8932</link>
      <description>Thank you. It worked for me.</description>
      <pubDate>Mon, 04 Apr 2011 18:07:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ordered-Macro-Variables/m-p/43579#M8932</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-04-04T18:07:38Z</dc:date>
    </item>
  </channel>
</rss>

