We can capture macro(%test) executed code with the below snippet
filename mprint 'output-file-name.sas';
options MPRINT MFILE;
%test;
options NOMPRINT NOMFILE;
Is there a way to capture the SAS executed code with MFILE option when we have datasteps/proc calls between the macro calls.
Example:
%test;
data ...
set ...
...
run;
%test2;
proc sort data=...
run;
%test3;
Using some sort of wrapper code to put the above code in a macro and then use MFILE ? Is there any automated standard approach ? I have to implement the solution at enterprise level.