As described in BTEQ Return Codes, the default return code assignments for Teradata Database error messages also determine the ERRORLEVEL status value that can be used in subsequent testing and branching commands, such as:
SELECT * FROM SOMEWHERE; .IF ERRORLEVEL >= 14 THEN .QUIT 17;
The ERRORLEVEL command can also be used to change the severity level associated with one or more error codes, as in the following example:
.SET ERRORLEVEL 2168 SEVERITY 4, (2173, 3342, 5262) SEVERITY 8 .SET ERRORLEVEL UNKNOWN SEVERITY 16
As shown above, UNKNOWN can also be used as a wildcard error number to accommodate any error codes that are not otherwise defined.