DATA Step, Macro, Functions and more

nested SAS macro

Reply
Super Contributor
Posts: 285

nested SAS macro

Hello,

 

I have a SAS progam like this format. I wonder how does it executes?  Thanks !

 

%macro a (par1 = );
    .........
	.........

	%macro b (par2 =);
	  ........
	  ........
	%mend b;

	%b;
       .........
       .........
%mend a;
   
%a;
Super Contributor
Posts: 282

Re: nested SAS macro

Posted in reply to SAS_inquisitive

Basically, the code does the following

 

1. Declares an inner macro (b) and executes it as part of the of the outer macro (a) declaration

2. Executes the newly declared macro (a)

 

Ahmed

Super User
Posts: 23,749

Re: nested SAS macro

Posted in reply to SAS_inquisitive

FYI - this is not a good way to write code, nesting macro definitions is inefficient for starters.

Super Contributor
Posts: 285

Re: nested SAS macro

@Reeza

 

I have inherited a lot of programs like this and I was trying to understand ! Thanks !

Ask a Question
Discussion stats
  • 3 replies
  • 155 views
  • 0 likes
  • 3 in conversation