DATA Step, Macro, Functions and more

nested SAS macro

Reply
Regular Contributor
Posts: 234

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;
Regular Contributor
Posts: 213

Re: nested SAS macro

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: 17,868

Re: nested SAS macro

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

Regular Contributor
Posts: 234

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
  • 140 views
  • 0 likes
  • 3 in conversation