Macro variables have what is referred to as scope which relates to where the macro variable exists and where it receives values. This is critical to understanding what happens with macro coding especially when you have macros that call other macros. A missing %local may result in some dreadful errors, either of run time logic results or actual code failures that can be hard to trace. So you do want to know what happens with and without %local.
Examine the code below and determine what the output that appears in the log should be.
Then run code. Does it match your expectations.
%macro dummy(parm);
%put Parm first used in dummy is: &parm.;
%dummy2(abc);
%put Parm after calling dummy2 is &parm.;
%mend;
%macro dummy2(p);
%let parm= &p &p;
%put p in dummy2 is: &p.;
%put parm in dummy2 is:&parm;
%mend;
%macro dummy3(parm);
%put Parm first used in dummy3 is: &parm.;
%dummy4(abc);
%put Parm after calling dummy4 is &parm.;
%mend;
%macro dummy4(p);
%local parm;
%let parm= &p &p;
%put p in dummy4 is: &p.;
%put parm in dummy4 is:&parm;
%mend;
%dummy(pdq)
%dummy3(pdq)