$ 0 0 You set MAXERROR to 2, and the default severity for 3807 is 8; since 8>2, BTEQ exits. Since 3807 <> 0, with this sequence of statements you would go to FINISH if you didn't exit firstAn option: override the severity of 3807 .set errorlevel 3807 severity 2; DELETE FROM UD466.FF_ACTIVE_INTAKE; .IF ERRORCODE = 0 THEN .GOTO ACTIVEREC; .IF ERRORCODE=3807 THEN .GOTO NextLBL; .IF ERRORCODE <> 0 THEN .GOTO FINISH; .LABEL NextLBL
An option: override the severity of 3807
.set errorlevel 3807 severity 2;
DELETE FROM UD466.FF_ACTIVE_INTAKE;
.IF ERRORCODE = 0 THEN .GOTO ACTIVEREC;
.IF ERRORCODE=3807 THEN .GOTO NextLBL;
.IF ERRORCODE <> 0 THEN .GOTO FINISH;
.LABEL NextLBL