<?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: Trying to call macro variables inside a do loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-call-macro-variables-inside-a-do-loop/m-p/786708#M251224</link>
    <description>Thank you for the reply..It works fine now...</description>
    <pubDate>Mon, 20 Dec 2021 10:45:08 GMT</pubDate>
    <dc:creator>deepakg77717</dc:creator>
    <dc:date>2021-12-20T10:45:08Z</dc:date>
    <item>
      <title>Trying to call macro variables inside a do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-call-macro-variables-inside-a-do-loop/m-p/786704#M251221</link>
      <description>&lt;P&gt;hi All,&lt;/P&gt;&lt;P&gt;I have created macro variables&lt;/P&gt;&lt;P&gt;%let B1=123;&lt;BR /&gt;%let B2=231;&lt;/P&gt;&lt;P&gt;%let B3=8;&lt;BR /&gt;Trying to call these inside a do loop.&lt;/P&gt;&lt;P&gt;data one;&lt;BR /&gt;array var[3] first second third ;&lt;BR /&gt;do j = 1 to 3;&lt;BR /&gt;var[j]= &amp;amp;Bj.;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;The above code does not work. Please suggest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 10:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-call-macro-variables-inside-a-do-loop/m-p/786704#M251221</guid>
      <dc:creator>deepakg77717</dc:creator>
      <dc:date>2021-12-20T10:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to call macro variables inside a do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-call-macro-variables-inside-a-do-loop/m-p/786707#M251223</link>
      <description>&lt;P&gt;Macro variables are normally resolved during datastep compilation, so in order to get at them dynamically in a datastep, you will have to use SYMGET:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
  array var[3] 8 first second third ;
  do j = 1 to 3;
    var[j]= input(symget(cats('B',j)),best32.);
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Dec 2021 10:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-call-macro-variables-inside-a-do-loop/m-p/786707#M251223</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2021-12-20T10:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to call macro variables inside a do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-call-macro-variables-inside-a-do-loop/m-p/786708#M251224</link>
      <description>Thank you for the reply..It works fine now...</description>
      <pubDate>Mon, 20 Dec 2021 10:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-call-macro-variables-inside-a-do-loop/m-p/786708#M251224</guid>
      <dc:creator>deepakg77717</dc:creator>
      <dc:date>2021-12-20T10:45:08Z</dc:date>
    </item>
  </channel>
</rss>

