The SQL procedure continues to process statements after an error occurs


SYNTAXCHECK is the default in batch. Once an error occurs, the expected behavior is that SAS internally sets the OBS= option to 0 and the REPLACE/NOREPLACE option to NOREPLACE. In addition, SAS should not write any observations to new data sets that SAS creates and should not execute most of the subsequent DATA steps or procedures in the program.

However, unexpected behavior occurs in PROC SQL. PROC SQL continues to process statements (such as DELETE and INSERT) after an error occurs.

Workaround

To circumvent this issue, set the following to force SAS to terminate when an error occurs:

Options errorabend;