DATA Step, Macro, Functions and more

nested SAS macro

Reply
Super Contributor
Posts: 271

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: 216

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: 19,789

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: 271

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