This program demonstrates the concept of Futility of Debugging of call execute DATA _null_; do i = 1 to 3; call execute(catt('%let i =',i,';%put note: i:&i;')); end; stop; run; %macro put_i(data=); data _null_; putlog "mvar i: &i from data"; stop; run; %put note: &sysmacroname: i:&i; %mend; DATA _null_; do i = 1 to 3; call execute(catt('%let i =',i,';%put_i')); end; stop; run; DATA _null_; file 'subroutine.sas'; put '%put note: i:&i. from subroutine;'; stop; run; DATA _null_; do i = 1 to 3; call execute(catt('%let i =',i ,';%include "subroutine.sas";' ,'%put note: i:&i in loop;')); end; stop; run; *NOTE: test of global mvar J This is what I mean by complexity: a macro with either of percent+do or percent+if; %let _global_j = 0; %macro put_mvar(mvar=,note=none); %if not &_global_j %then %put note: &sysmacroname: mvar:&mvar, note=¬e; %else %put note: &sysmacroname: nothing to report, note=¬e; %mend; %let _global_j = 0; DATA _null_; do i = 1 to 3; call execute(catt('%put_mvar(mvar=',i,')')); call execute(catt('%nrstr(%put_mvar(mvar=',i,',note=nrstr))')); end; stop; %let _global_j = 1; %put note: _global_j = &_global_j; run; %put note: _global_j = &_global_j; Ron Fehd macro maven
... View more