@quickbluefish - What I typically ensure with %INCLUDE chained jobs is that the SAS OPTION SYNTAXCHECK is set. This is set by default for batch jobs anyway. With this option an error still results in ALL code still running, including the %INCLUDE programs, but no data is processed as OBS = 0 has been set. This means failed jobs finish quickly but still contain complete logs which in my view is ideal for troubleshooting.
@SASKiwi Not sure how SAS behaves in current versions but at least in the past even with SAS in syntax check mode some code still executed (like full pass-through SQL) which can lead to issues.
@Patrick - I haven't seen that behaviour in the versions we use, the oldest being 9.4M2. We in fact use SQL Passthru a lot, and that is most commonly where our programs break. Following an SQL Passthru error we typically see an SQL connection CLI error, SYNTAXCHECK mode switches on and the rest of the program finishes quickly as no further data is processed.
Can you describe your current scenario? You say:
"So, let's say I have 3 SAS programs under the batch ..."
A SAS batch job is not a group of programs that are run in series.
From what you have shared, others have guessed that you have a .bat file (or maybe a powershell script?) which is invoking multiple SAS sessions in series. Is that correct?
Can you please share the code for that script, just so that we can be clear that we're understanding your scenario? Or if you are using some other program to orchestrate the execution of a series of SAS programs, please provide the details on how your are doing this.
If you have a single Task Scheduler task which executes three SAS programs, please show the code / setup for that task.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.