DATA Step, Macro, Functions and more

Problem with sas batch mode

Posts: 25

Problem with sas batch mode

I have the following problem with sas batch mode:


During program execution in batch mode if there is any error the rest of the program is not executed.

There is an option or trick to make the rest of the program executed.




Thank you very much for all your help

Posts: 2,307

Re: Problem with sas batch mode

Look at these options


NOERRORABEND Does not end SAS for most errors, issues an error message, sets OBS=0, and goes into syntax check mode.
NOERRORBYABEND Does not end a SAS program when an error occurs in BY-group processing, issues an error, and continues


I question why you would want this behaviour though.

Respected Advisor
Posts: 4,665

Re: Problem with sas batch mode


I'd say that execution stops once an error has been encountered is a good thing. You'll enter into an undefined situation after an error and if processing would continue then unexpected things could happen (i.e. overwriting a table with wrong data).


If you want some process to execute after program failure (i.e. sending out an email alert) then consider using a scheduler where you then check the return code of the process and in case of failure have the scheduler trigger another program which send out the email (or whatever else you want to do).

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation