-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
Description
If a SAS macro is defined like so:
%macro outer();
/* any amount of arbitrary code */
%macro inner();
%put inner;
%mend;
%inner()
%put outer;
%mend;
%outer()This is widely considered as bad practice, because the inner definition is recompiled every time the outer macro is invoked.
We should create a lint warning if a subsequent %macro is discovered before a %mend in a SAS program.
For reference, a more 'correct' way to have defined the above would have been:
%macro inner();
%put inner;
%mend;
%macro outer();
/* any amount of arbitrary code */
%inner()
%put outer;
%mend;
%outer()Rule name: noNestedMacros