<?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: SAS Macro Problem - Please Help in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Macro-Problem-Please-Help/m-p/92512#M26329</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%GLOBAL num2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statement inside your macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;macro variables created within a macro are local to that macro. However, you could've also swapped your %put &amp;amp;num2.; statement inside the macro for the same result. That is, the macro worked fine you just did not consider the scope of the variable for your intended purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Jul 2013 18:14:15 GMT</pubDate>
    <dc:creator>Vince28_Statcan</dc:creator>
    <dc:date>2013-07-26T18:14:15Z</dc:date>
    <item>
      <title>SAS Macro Problem - Please Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Macro-Problem-Please-Help/m-p/92511#M26328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the following output&lt;/P&gt;&lt;P&gt;num2 = Code493736&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where, num = 493736. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following code but I am not any value in num2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;%let num=493736;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;%macro see1();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;%if %length(&amp;amp;num.)&amp;gt;4 %then %do; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;%let num1 = %cmpres(&amp;amp;num.);&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;%let num2 = Code&amp;amp;num1.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;%end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;%see1();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG&gt;%put &amp;amp;num2.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Pihu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 18:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Macro-Problem-Please-Help/m-p/92511#M26328</guid>
      <dc:creator>pihu_11</dc:creator>
      <dc:date>2013-07-26T18:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Problem - Please Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Macro-Problem-Please-Help/m-p/92512#M26329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%GLOBAL num2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statement inside your macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;macro variables created within a macro are local to that macro. However, you could've also swapped your %put &amp;amp;num2.; statement inside the macro for the same result. That is, the macro worked fine you just did not consider the scope of the variable for your intended purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 18:14:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Macro-Problem-Please-Help/m-p/92512#M26329</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-07-26T18:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Problem - Please Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Macro-Problem-Please-Help/m-p/92513#M26330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a ton!&lt;/P&gt;&lt;P&gt;It works now &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 18:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Macro-Problem-Please-Help/m-p/92513#M26330</guid>
      <dc:creator>pihu_11</dc:creator>
      <dc:date>2013-07-26T18:19:12Z</dc:date>
    </item>
  </channel>
</rss>

