03-08-2012 11:01 AM
So I am using a master file that contains about 6 %include statements calling my bigger sas programs.
Problem is that when I run this master file SAS stops working after the first few programs and just ignores the rest of the file.... no errors are seen in the log either...
How can I fix this problem?
03-08-2012 11:07 AM
A first possibility I can think of is the SAS hasn't stopped running but is waiting for a quit statement. If so, if you run each of the programs manually in order without using an include statement you may be able to see where it is waiting for an exiting statement.
03-08-2012 12:18 PM
You might also check the line lengths on the programs. Perhaps SAS is truncating some lines when using %INC that are not truncated when it is the main program.
Can you run them one by one in the same SAS sessions without errors? Perhaps some options, macro variables, librefs , work datasets create by one of the earlier programs is causing the later programs to execute differently than they do if run individually.
03-08-2012 01:35 PM
I'm with data _null_ that if these are independent programs using SYSTASK would be the right thing to do (and you could even run your programs in parallel).
If you want to stick with %include then below options could help:
options s=0 s2=0 source2;
The first two options set the allowed code line length to the maximum, source2 shows you the code of "includes" in the log which makes debugging easier.
03-08-2012 02:39 PM
And here examples of how to use systask to start SAS jobs:
03-08-2012 03:13 PM
%include C:\program1.sas / lrecl=32767; run;
seems to solve the problem for a few but this still happenes in the later programs... maybe this can help diagnose the problem better?
03-09-2012 08:49 PM
There are length limitations for source code documented. What limitations there are depends on your OS and SAS version (what do you have).
For debugging I would first try and figure out which %include is the first one no more working. Then I would run only this %include and see if the problem persists.
If it is a code line length issue: Could you please explain how it comes that your code is all on one line. Could you also explain how you run your code (both separately and via %include statement). Are you using for both the same environment and client?
12-04-2015 06:30 PM
In case anyone else has this problem, I figured out one potential cause and solution.
In the program that the %include called, I'd commented out the end of my code using "/*". Since it was the end of the program, I'd not closed the block comments with a matching "*/". This was causing the parent program to have subsequent code commented out.
06-01-2016 01:09 PM
Yep-if you're using a %include, and it's mysteriously not running anything after what's in the called-in program, check the called-program for a comment that isn't closed at the end of the code.