<?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: Macro calling Warning in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-calling-Warning/m-p/791220#M253388</link>
    <description>&lt;P&gt;Yes, because your _1p macro variable is local to the p macro&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1b76sxg9dbcyrn1l5age5j5nvgw.htm" target="_self"&gt;Scope of macro variables&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro p;
  %global _1p ;
  %let _1p = 184;
%mend p;

%p;

%put RESULT = &amp;amp;_1p.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Jan 2022 18:14:31 GMT</pubDate>
    <dc:creator>AMSAS</dc:creator>
    <dc:date>2022-01-20T18:14:31Z</dc:date>
    <item>
      <title>Macro calling Warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-calling-Warning/m-p/791218#M253387</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;%macro p;
  %let _1p = 184;
%mend p;

%p;

%put RESULT = &amp;amp;_1p.;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am getting warning for above code as...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;WARNING: Apparent symbolic reference _1P not resolved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;can anyone please help&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 18:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-calling-Warning/m-p/791218#M253387</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2022-01-20T18:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Macro calling Warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-calling-Warning/m-p/791220#M253388</link>
      <description>&lt;P&gt;Yes, because your _1p macro variable is local to the p macro&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1b76sxg9dbcyrn1l5age5j5nvgw.htm" target="_self"&gt;Scope of macro variables&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro p;
  %global _1p ;
  %let _1p = 184;
%mend p;

%p;

%put RESULT = &amp;amp;_1p.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jan 2022 18:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-calling-Warning/m-p/791220#M253388</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-01-20T18:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro calling Warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-calling-Warning/m-p/791221#M253389</link>
      <description>I need to use _1p after the macro p ends.&lt;BR /&gt;any suggestion</description>
      <pubDate>Thu, 20 Jan 2022 18:13:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-calling-Warning/m-p/791221#M253389</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2022-01-20T18:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro calling Warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-calling-Warning/m-p/791222#M253390</link>
      <description>&lt;P&gt;If you want _1P to be available after the P macro finishes running the make sure it is NOT local to P.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let _1p=BEFORE;
%p;
%put &amp;amp;=_1p;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could modify the macro to force it to be GLOBAL if is doesn't already exist.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro p;
%if not %symexist(_1p) %then %global _1p;
%let _1p=from macro p;
%mend p;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Terminology correction: You macro call worked fine. It was the macro variable you tried to reference after the macro had finished running that was generating the warning.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 18:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-calling-Warning/m-p/791222#M253390</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-01-20T18:27:51Z</dc:date>
    </item>
  </channel>
</rss>

