When you say "If there are more macro definitions in there, they might be part of the problem", what do you mean by that? The files I am trying to add with %include do have other macros in them, however I have tested them all for months and they all run flawlessly on their own. All I am trying to do is wrap them all together into one process that chooses which set of files to run based on a user prompt. I have been trying to work with a simplified version of the process; the code I sent is only testing with two program files, but eventually there will be around 15 files per path. What's happening is this: 1. I run the code and it correctly selects the filepath. 2. It runs the first %include program just fine. 3. The log shows "NOTE: %INCLUDE (level 1) ending." 4. It starts the second file with log: "NOTE: %INCLUDE (level 1) file mypath\folder1\program2.sas is file mypath\folder1\program2.sas." 5. The log shows all of the code from program2 but none of it runs. 6. After a macro function within program2 is ended, the log generates "NOTE: Extraneous text on %END statement ignored." and then the code stops running and gives another "NOTE: %INCLUDE (level 1) ending." From my actual code log here is what that looks like: 1858 +%mend choose_data; This is the end of the macro within program2 NOTE: Extraneous text on %END statement ignored. 1859 + 1860 +/* Run population data creation */ These are the lines that run the macro in program2 1861 +%choose_data(&use_data.); except they don't actually run. So, I think when you say that having macro definitions within this may be a problem, you might be on to something. Regarding the unbalanced note I get, I have looked for anything unbalanced but can't find anything. As I said above, all the %include programs run with no warnings or errors, so they are all closed fine. Another user (Ksharp) mentioned that they tried my code and it worked fine, so I think it's balanced. This is one of the parts that's so maddening. When I open SAS EG I can run the code and just get the situation above (first program runs, second one doesn't). If I try to run a second time, that's when the unbalanced error comes up and then nothing runs at all. I have to completely close and restart SAS EG to try again.
... View more