10-02-2017 01:39 PM
I ran the following program using the SAS EG. I defined a macro run_macro in the main program. I created a separate program macro_1.sas in /foldername/ folder which contains a macro macro_1. After I make changes in macro_1.sas and run the main program, why is the SAS keep running the same codes before the changes? It runs the program correctly only if I close the SAS, re-open and run. Does someone know why?
options pagesize=59 mautosource sasautos="/foldername/";
10-02-2017 02:00 PM
You are observing standard behavior. SAS does not look for the macro definition each time you use the macro. It only searches for the macro definition if the macro is not yet defined. So you have changed the definition, but SAS doesn't look for the new definition.
For a contining EG session, try adding a %INCLUDE statement to bring in the file holding the revised macro definition. %INCLUDE can be placed either inside or outside a macro definition, wherever you see fit to redefine a macro.
Need further help from the community? Please ask a new question.