I am missing the reference to: &SYSCC. Coding an abort is not always applicable (batch/interactive) . At the end of the program a check can be made. &syscc can be modified in your own sas program. An other one is that trying to analyse logfiles to solve the different behavior interactie / batch easily gets overcomplicated and introduces possible weird effects in scripting dependencies. https://documentation.sas.com/?docsetId=mcrolref&docsetTarget=p11nt7mv7k9hl4n1x9zwkralgq1b.htm&docsetVersion=9.4&locale=us