<?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 Editor Fail to Identify Code Block for Macro within macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711879#M219356</link>
    <description>&lt;P&gt;&amp;nbsp;In some languages it is possible to define local functions.&amp;nbsp; But with the SAS macro processor you can only have one macro named MYMACRO that exist at any given point in time, there is no way to create a local macro.&amp;nbsp; &amp;nbsp;If you think of the list of defined macros as a directory there is no way to create subdirectories.&amp;nbsp; &amp;nbsp;So if you get in the habit of defining macros that re-define other macros and then start having them call each other you can quickly end up with name conflicts.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Jan 2021 19:33:45 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-01-16T19:33:45Z</dc:date>
    <item>
      <title>SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/689418#M209589</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;@I'm pretty green to SAS and SAS EG. I try to define macro within macro but turns out I got the problem as described in 'MACRO within a MACRO problems'&amp;nbsp;&lt;LI-MESSAGE title="MACRO within a MACRO problems." uid="41289" url="https://communities.sas.com/t5/SAS-Programming/MACRO-within-a-MACRO-problems/m-p/41289#U41289" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;, that no lines underneath the MEND statement, which means SAS enhanced editor fail to identify the code block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that it's a bad practice to write&amp;nbsp;macro within macro but I'm doing so to reduce the numbers of&amp;nbsp;codes as I need to create a lot of similar subqueries that is having the same select and joining clause(or same clause applying to different tables, the idea is that the code are similar and I want to write them in one macro).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to tell the SAS editor&amp;nbsp;where the code ends so that it can be collapsed for easier navigation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or what is the correct way to write macro within macro so that I won't encounter this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My high level example code is as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro M1(code);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if code=1 %then %do;&lt;/P&gt;&lt;P&gt;%macro whereclause();&lt;/P&gt;&lt;P&gt;Where t1.c3=A1 and t1.c4=B1&lt;/P&gt;&lt;P&gt;%mend whereclause();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro groupclause();&lt;/P&gt;&lt;P&gt;Group by t1.c3, t1.c4&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend groupclause();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if code=2 %then %do;&lt;/P&gt;&lt;P&gt;%macro whereclause();&lt;/P&gt;&lt;P&gt;Where t1.c3=A2 and t1.c4=B2 and t1.c4=D2 &amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend whereclause();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro groupclause();&lt;/P&gt;&lt;P&gt;Group by t1.c3, t1.c4, t1.c5&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend groupclause();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(select t1.c1,&amp;nbsp;t1.c2, t1.c3, t1.c4, t1.c5, max(t1.c2) as c6&amp;nbsp;&lt;/P&gt;&lt;P&gt;from t1 inner t2 on t1.c1=t2.c1 and t1.c2=t2.c2&lt;/P&gt;&lt;P&gt;%whereclause()&lt;/P&gt;&lt;P&gt;%groupclause()&amp;nbsp;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;%mend M1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 03:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/689418#M209589</guid>
      <dc:creator>PeterPZC</dc:creator>
      <dc:date>2020-10-07T03:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/689427#M209592</link>
      <description>&lt;P&gt;There’s a reason to not nest macros. Explain what you’d like to do overall and many people will offer solutions and options but nesting macros is a bad idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/168662"&gt;@PeterPZC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;@I'm pretty green to SAS and SAS EG. I try to define macro within macro but turns out I got the problem as described in 'MACRO within a MACRO problems'&amp;nbsp;&lt;LI-MESSAGE title="MACRO within a MACRO problems." uid="41289" url="https://communities.sas.com/t5/SAS-Programming/MACRO-within-a-MACRO-problems/m-p/41289#U41289" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;, that no lines underneath the MEND statement, which means SAS enhanced editor fail to identify the code block.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand that it's a bad practice to write&amp;nbsp;macro within macro but I'm doing so to reduce the numbers of&amp;nbsp;codes as I need to create a lot of similar subqueries that is having the same select and joining clause(or same clause applying to different tables, the idea is that the code are similar and I want to write them in one macro).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to tell the SAS editor&amp;nbsp;where the code ends so that it can be collapsed for easier navigation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or what is the correct way to write macro within macro so that I won't encounter this problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My high level example code is as follow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro M1(code);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if code=1 %then %do;&lt;/P&gt;
&lt;P&gt;%macro whereclause();&lt;/P&gt;
&lt;P&gt;Where t1.c3=A1 and t1.c4=B1&lt;/P&gt;
&lt;P&gt;%mend whereclause();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro groupclause();&lt;/P&gt;
&lt;P&gt;Group by t1.c3, t1.c4&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend groupclause();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if code=2 %then %do;&lt;/P&gt;
&lt;P&gt;%macro whereclause();&lt;/P&gt;
&lt;P&gt;Where t1.c3=A2 and t1.c4=B2 and t1.c4=D2 &amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend whereclause();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro groupclause();&lt;/P&gt;
&lt;P&gt;Group by t1.c3, t1.c4, t1.c5&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend groupclause();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(select t1.c1,&amp;nbsp;t1.c2, t1.c3, t1.c4, t1.c5, max(t1.c2) as c6&amp;nbsp;&lt;/P&gt;
&lt;P&gt;from t1 inner t2 on t1.c1=t2.c1 and t1.c2=t2.c2&lt;/P&gt;
&lt;P&gt;%whereclause()&lt;/P&gt;
&lt;P&gt;%groupclause()&amp;nbsp;&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;%mend M1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 04:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/689427#M209592</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-07T04:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/689438#M209600</link>
      <description>&lt;P&gt;Peter,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's no benefit to placing one macro &lt;STRONG&gt;definition&lt;/STRONG&gt; within another macro.&amp;nbsp; You can place a &lt;STRONG&gt;call&lt;/STRONG&gt; to another macro from within a macro definition, but not another definition.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a look at the following code.&amp;nbsp; Please copy this into a SAS editor window (or Jupyter notebook) and run it.&amp;nbsp; Please tell me the difference in the results between having one macro definition inside another vs. two separate macro definitions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;**	Bad code.  Do NOT do it!	**;
%Macro	Mac1;
	%PUT	NOTE:  Hello I am Mac1;

	%Macro	Mac2;
		%PUT	NOTE-  And I am Mac2;
	%Mend	Mac2;

	%Mac2;
%Mend	Mac1;

%Mac1;

**------------------------------------------------------------------------------**;

**	Good code.  Same result.  Do it!	**;
%Macro	Mac1;
	%PUT	NOTE:  Hello I am Mac1;
	%Mac2;
%Mend	Mac1;

%Macro	Mac2;
	%PUT	NOTE-  And I am Mac2;
%Mend	Mac2;

%Mac1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Oct 2020 04:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/689438#M209600</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-07T04:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/689481#M209615</link>
      <description>&lt;P&gt;Don't pay too much attention to the editor's parser. While it's useful when it works, it's not very clever.&lt;/P&gt;
&lt;P&gt;Your code however is bad practice, and also erroneous. It cannot possibly run as expected.&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro M1(code);

  %local grp wh;

  %if &amp;amp;code=1 %then %do;
    %let wh =t1.c3=A1 and t1.c4=B1;
    %let grp=t1.c3, t1.c4 ;
  %end;

  %if &amp;amp;code=2 %then %do;
    %let wh =t1.c3=A2 and t1.c4=B2 and t1.c4=D2  ;
    %let grp=t1.c3, t1.c4, t1.c5 ;
  %end;

  .
  .
  .
   

  (select t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, max(t1.c2) as c6 

  from t1 inner t2 on t1.c1=t2.c1 and t1.c2=t2.c2

  where &amp;amp;wh

  group by &amp;amp;grp 

  )

%mend M1;

 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 08:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/689481#M209615</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-10-07T08:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711693#M219274</link>
      <description>&lt;P&gt;I'm doing this for a code migration project from Access to SAS. In Access, the code is written in separate queries with specific ID to keep track. They are calling one and another just like the code that I wrote for demo. I would like to mimic the way they were written in Access but i don't want to create so many temp table as in Access so I'm using multiple nested macro.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 15:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711693#M219274</guid>
      <dc:creator>PeterPZC</dc:creator>
      <dc:date>2021-01-15T15:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711694#M219275</link>
      <description>I want to do nested macro because i'm actually creating similar tables (select from with different where clause/group clause etc.) I would like to create macro that takes ID as input and hence they can create slightly different tables based on the input. It's like making lego.</description>
      <pubDate>Fri, 15 Jan 2021 16:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711694#M219275</guid>
      <dc:creator>PeterPZC</dc:creator>
      <dc:date>2021-01-15T16:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711695#M219276</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/168662"&gt;@PeterPZC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm doing this for a code migration project from Access to SAS. In Access, the code is written in separate queries with specific ID to keep track. They are calling one and another just like the code that I wrote for demo. I would like to mimic the way they were written in Access but i don't want to create so many temp table as in Access so I'm using multiple nested macro.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The number of temporary datasets you create has nothing to do with whether your code has nested macro definitions, nested macro executions, or even uses any macros at all.&amp;nbsp; Instead that is a design decision on the code you want to run, however the code ends up being generated.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 16:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711695#M219276</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-15T16:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711699#M219277</link>
      <description>&lt;P&gt;Looks to me like your "nested" macro definitions should just be macro variables instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro M1(code);
%local whereclause groupclause;
%if &amp;amp;code=1 %then %do;
 %let whereclause=Where t1.c3=A1 and t1.c4=B1;
  %let groupclause=Group by t1.c3, t1.c4 ;
%end;
%else if &amp;amp;code=2 %then %do;
...
%end;
...
(select t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, max(t1.c2) as c6 
 from t1 inner t2 on t1.c1=t2.c1 and t1.c2=t2.c2
 &amp;amp;whereclause
 &amp;amp;groupclause
)
...
%mend M1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Jan 2021 16:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711699#M219277</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-15T16:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711701#M219278</link>
      <description>Btw, thank all who replied letting me know that it's a bad practice to do so.</description>
      <pubDate>Fri, 15 Jan 2021 16:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711701#M219278</guid>
      <dc:creator>PeterPZC</dc:creator>
      <dc:date>2021-01-15T16:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711704#M219279</link>
      <description>Thanks Chris, actually my way of writing do run as expected but the project ceased due to poor performance of SAS comparing to Access. I don't know why, maybe looping is faster in Access than SAS? Anyway, I will try you way next time (hopefully not, as everyone said, it's bad practice)!</description>
      <pubDate>Fri, 15 Jan 2021 16:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711704#M219279</guid>
      <dc:creator>PeterPZC</dc:creator>
      <dc:date>2021-01-15T16:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711706#M219280</link>
      <description>&lt;P&gt;Perhaps it is the looping that is the issue, not SAS. "Looping" not a normal practice for data analysis. Usually you just code what you want to happen for all observations and let it rip.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 16:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711706#M219280</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-15T16:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711716#M219286</link>
      <description>In my case, yes. But what if the code defined in nested macro is more complicated (like a subquery, "fromclause .....") and cannot be defined as macro variable?&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Jan 2021 16:43:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711716#M219286</guid>
      <dc:creator>PeterPZC</dc:creator>
      <dc:date>2021-01-15T16:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711719#M219287</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/168662"&gt;@PeterPZC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;In my case, yes. But what if the code defined in nested macro is more complicated (like a subquery, "fromclause .....") and cannot be defined as macro variable?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;All macro code and macro variables generate is text to pass onto to SAS itself to be interpreted code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you saying that some of those macro generated more than 65K bytes of code?&lt;/P&gt;
&lt;P&gt;Or are you saying that the macro generates multiple SAS statements?&amp;nbsp; There are ways to store multiple statements into a macro variable, you just need to add some macro quoting around the semi-colons and then you can use %unquote(&amp;amp;mvar) to remove the macro quoting and let SAS process the generated code.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 16:51:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711719#M219287</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-15T16:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711723#M219289</link>
      <description>I see, but it's quite complicated.... need to mask those characters and will make the code hard to read.... Why can't we just use nested macro instead?</description>
      <pubDate>Fri, 15 Jan 2021 17:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711723#M219289</guid>
      <dc:creator>PeterPZC</dc:creator>
      <dc:date>2021-01-15T17:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711725#M219291</link>
      <description>&lt;P&gt;You can do it, but I suspect it will just make your code harder to understand and manage than if you approached to problem in a more direct way.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the name space for macros is flat, there is no concept of LOCAL macro definition like there is for macro variables, so the potential for name collision is much greater and harder to manage.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 17:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711725#M219291</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-15T17:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711822#M219331</link>
      <description>Thanks Tom, for this project, since there is a large amount of code to be transferred from Access sql to SAS, I think it will take less time to do it if i avoid the masking. Btw, may I know what do you mean by name space is flat?</description>
      <pubDate>Sat, 16 Jan 2021 03:21:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711822#M219331</guid>
      <dc:creator>PeterPZC</dc:creator>
      <dc:date>2021-01-16T03:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Editor Fail to Identify Code Block for Macro within macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711879#M219356</link>
      <description>&lt;P&gt;&amp;nbsp;In some languages it is possible to define local functions.&amp;nbsp; But with the SAS macro processor you can only have one macro named MYMACRO that exist at any given point in time, there is no way to create a local macro.&amp;nbsp; &amp;nbsp;If you think of the list of defined macros as a directory there is no way to create subdirectories.&amp;nbsp; &amp;nbsp;So if you get in the habit of defining macros that re-define other macros and then start having them call each other you can quickly end up with name conflicts.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2021 19:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Editor-Fail-to-Identify-Code-Block-for-Macro-within-macro/m-p/711879#M219356</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-16T19:33:45Z</dc:date>
    </item>
  </channel>
</rss>

