Pretty much the title. I think I found a bug in SAS macros. I found the cause of my problem but would like to share my findings with the developers. The closest I could get was posting here or contacting Techincal support. As far as I could tell they have no ability to address this type of issue so here I am. The script below shows how to create the bug and what its effects are. /* this will compile just fine */
%macro macA();
%local a;
%let a=1;
proc print data=sashelp.cars;
run;
%mend macA;
/* this will compile just fine */
%macro macB();
%local b /* i forget the semicolon */
%macA();
proc print data=sashelp.air;
run;
%mend;
/* this will give an error when I run it*/
%macB();
/* now no matter what you do, you can no longer recompile the macro %maca when you want to change it. It will return the error
ERROR: The macro MACA is still executing and cannot be redefined.
ERROR: A dummy macro will be compiled
*/
/* goahead try it */
%macro macA();
%local a;
%let a=1;
proc print data=sashelp.cars;
run;
%mend macA;
/* this will compile thought */
%macro macc();
%local a;
%let a=1;
proc print data=sashelp.cars;
run;
%mend macc;
/* you can still execute code, no problem, despite the macro supposedly still running but you can't recompile maca at this point. */
proc print data=sashelp.company;
run; Since I know this will be asked: NOTE: Copyright (c) 2016 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M7)
Licensed to ______________________________
NOTE: This session is executing on the X64_10PRO platform.
NOTE: Analytical products:
SAS/STAT 15.2
SAS/ETS 15.2
SAS/IML 15.2
SAS/QC 15.2
NOTE: Additional host information:
X64_10PRO WIN 10.0.18362 Workstation
NOTE: SAS initialization used:
real time 1.64 seconds
cpu time 1.13 seconds
... View more