<?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 Question regarding Local symbol table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Question-regarding-Local-symbol-table/m-p/176318#M33782</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Verdana','sans-serif'; color: black;"&gt;Which title statement will be printed as a result of the SAS code shown below?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Verdana','sans-serif'; color: black;"&gt;&lt;IMG alt="a.jpg" class="jive-image" src="https://communities.sas.com/legacyfs/online/6460_a.jpg" /&gt;&lt;BR /&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Verdana','sans-serif'; color: black;"&gt;Listing of MTEST Macro Variables&lt;INPUT type="text" value="" /&gt;Listing of Macro Variables&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;INPUT type="text" value="" /&gt;Listing of GLOBAL Macro Variables&lt;INPUT type="text" value="" /&gt;Listing of &amp;amp;val3 Macro Variables&lt;INPUT type="text" value="" /&gt;There is no title because the code produces an error in the log.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: black; font-size: 10.0pt; font-family: 'Verdana','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: black; font-size: 10.0pt; font-family: 'Verdana','sans-serif';"&gt;According to me Local symbol table has Va13=MTEST macro variable once it finishes execution local symbol table gets deleted and only global symbol table remains so The correct ans would be " &lt;SPAN style="color: #000000; font-family: Verdana, sans-serif; background-color: #ffffff;"&gt;Listing of GLOBAL Macro Variables&lt;/SPAN&gt; "??&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 05:39:12 GMT</pubDate>
    <dc:creator>poo</dc:creator>
    <dc:date>2014-05-29T05:39:12Z</dc:date>
    <item>
      <title>Question regarding Local symbol table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-regarding-Local-symbol-table/m-p/176318#M33782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Verdana','sans-serif'; color: black;"&gt;Which title statement will be printed as a result of the SAS code shown below?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Verdana','sans-serif'; color: black;"&gt;&lt;IMG alt="a.jpg" class="jive-image" src="https://communities.sas.com/legacyfs/online/6460_a.jpg" /&gt;&lt;BR /&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Verdana','sans-serif'; color: black;"&gt;Listing of MTEST Macro Variables&lt;INPUT type="text" value="" /&gt;Listing of Macro Variables&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;INPUT type="text" value="" /&gt;Listing of GLOBAL Macro Variables&lt;INPUT type="text" value="" /&gt;Listing of &amp;amp;val3 Macro Variables&lt;INPUT type="text" value="" /&gt;There is no title because the code produces an error in the log.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: black; font-size: 10.0pt; font-family: 'Verdana','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: black; font-size: 10.0pt; font-family: 'Verdana','sans-serif';"&gt;According to me Local symbol table has Va13=MTEST macro variable once it finishes execution local symbol table gets deleted and only global symbol table remains so The correct ans would be " &lt;SPAN style="color: #000000; font-family: Verdana, sans-serif; background-color: #ffffff;"&gt;Listing of GLOBAL Macro Variables&lt;/SPAN&gt; "??&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 05:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-regarding-Local-symbol-table/m-p/176318#M33782</guid>
      <dc:creator>poo</dc:creator>
      <dc:date>2014-05-29T05:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Local symbol table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-regarding-Local-symbol-table/m-p/176319#M33783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mentioned Local symbol table has val3=MTEST and the scope variable in proc print will be having the scope of MTEST only , not GLOBAL because the global macro variable will be overwritten with local macro variable if it is with same name..I took a sample data and checked which might help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let val3=GLOBAL;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt; input var $ scope $;&lt;/P&gt;&lt;P&gt; cards;&lt;/P&gt;&lt;P&gt; var1 LOCAL&lt;/P&gt;&lt;P&gt; var2 GLOBAL&lt;/P&gt;&lt;P&gt; var3 LOCAL&lt;/P&gt;&lt;P&gt; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;options symbolgen;&lt;/P&gt;&lt;P&gt;%macro mtest(val1,val2,val3=MTEST);&lt;/P&gt;&lt;P&gt; title "Listing of &amp;amp;val3 Macro Variables";&lt;/P&gt;&lt;P&gt;proc print data=&amp;amp;val1;&lt;/P&gt;&lt;P&gt; where scope="&amp;amp;val3";&lt;/P&gt;&lt;P&gt;Var &amp;amp;val2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mtest(test,var); /* This macro returns val3=MTEST only */&lt;/P&gt;&lt;P&gt;%mtest(test,var,val3=&amp;amp;val3); /* here i have declared val3 will take the global macro variable value as GLOBAL */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLease find the snapshot for the below macro output.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="global.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6461_global.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 07:19:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-regarding-Local-symbol-table/m-p/176319#M33783</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2014-05-29T07:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Local symbol table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-regarding-Local-symbol-table/m-p/176320#M33784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Vish33 very much, I have exam tomorrow I was lil confuse with that question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 15:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-regarding-Local-symbol-table/m-p/176320#M33784</guid>
      <dc:creator>poo</dc:creator>
      <dc:date>2014-05-29T15:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Local symbol table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-regarding-Local-symbol-table/m-p/176321#M33785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;welcome Poo..All the best&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 06:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-regarding-Local-symbol-table/m-p/176321#M33785</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2014-05-30T06:13:48Z</dc:date>
    </item>
  </channel>
</rss>

