<?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 use a created &amp;amp;varlist in %macroA in %macroB in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242633#M55830</link>
    <description>&lt;P&gt;Hi folks - it could seems a silly question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a varlist as a result of macroA.&lt;/P&gt;&lt;P&gt;%macroA;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;%put &amp;amp;varlist;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to use the created varlist in macroA in macroB as input.&lt;/P&gt;&lt;P&gt;but SAS errors me that &amp;amp;varlist is not recognised.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help me in this regard....&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jan 2016 00:30:54 GMT</pubDate>
    <dc:creator>Moh</dc:creator>
    <dc:date>2016-01-11T00:30:54Z</dc:date>
    <item>
      <title>How to use a created &amp;varlist in %macroA in %macroB</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242633#M55830</link>
      <description>&lt;P&gt;Hi folks - it could seems a silly question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a varlist as a result of macroA.&lt;/P&gt;&lt;P&gt;%macroA;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;%put &amp;amp;varlist;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to use the created varlist in macroA in macroB as input.&lt;/P&gt;&lt;P&gt;but SAS errors me that &amp;amp;varlist is not recognised.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help me in this regard....&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 00:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242633#M55830</guid>
      <dc:creator>Moh</dc:creator>
      <dc:date>2016-01-11T00:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a created &amp;varlist in %macroA in %macroB</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242634#M55831</link>
      <description>Could you please let us know how you are using the &amp;amp;varlist in macro B. Is the macro variable &amp;amp;varlist resolving</description>
      <pubDate>Mon, 11 Jan 2016 00:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242634#M55831</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-01-11T00:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a created &amp;varlist in %macroA in %macroB</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242636#M55833</link>
      <description>&lt;P&gt;Within %macroA, add this statement early:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%global varlist;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will keep it around after %macroA ends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 01:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242636#M55833</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-01-11T01:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a created &amp;varlist in %macroA in %macroB</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242638#M55834</link>
      <description>&lt;P&gt;The issue is variable&amp;nbsp;scope.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A macro variable created within a macro, is local, it only exists within the macro. To use the macro variable outside of the macro you need to change the scope to global, as someone has already indicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%global varlist;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're creating a macro variable using call symput, change to call symputx and use the -g option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 02:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242638#M55834</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-11T02:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a created &amp;varlist in %macroA in %macroB</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242689#M55842</link>
      <description>&lt;P&gt;Apart from using globals, you can make each call of the macro to be substituted&lt;/P&gt;
&lt;P&gt;by the variables list as follows :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro macroA;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Code to generate the list */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [...]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;varlist&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend macroA;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro macroB;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let variables=%macroA;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [...]&lt;/P&gt;
&lt;P&gt;%mend macroB;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 12:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242689#M55842</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2016-01-11T12:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a created &amp;varlist in %macroA in %macroB</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242697#M55843</link>
      <description>&lt;P&gt;thanks...&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 13:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-created-amp-varlist-in-macroA-in-macroB/m-p/242697#M55843</guid>
      <dc:creator>Moh</dc:creator>
      <dc:date>2016-01-11T13:53:11Z</dc:date>
    </item>
  </channel>
</rss>

