16.20 - EXIT or QUIT - Basic Teradata Query

Basic Teradata Query Reference

Basic Teradata Query
October 2018
Programming Reference


Logs off all database sessions and then exits BTEQ.

The highest severity value encountered during BTEQ's execution will by default be used as BTEQ's return code value unless an argument is explicitly supplied.


where the following is true:

A decimal number as the job step return code.

To avoid existing codes, do not use numbers 1 through 10.

One of the following status value keywords: ACTIVITYCOUNT, ERRORCODE, ERRORLEVEL, WARNINGCODE or SYSTEMRETURNCODE. SYSTEMRETURNCODE can be specified only when using Windows BTEQ. ACTIVITYCO will also be accepted in place of ACTIVITYCOUNT. See Status Value Keywords for full descriptions of each value.

Usage Notes

The EXIT and QUIT commands are identical. The alternate command name, QUIT, is supplied to enable users to employ stylistic conventions that differentiate normal versus non-normal exit paths in input scripts submitted in batch mode. For example, some users prefer to use QUIT when the BTEQ process exit is to come at the end of an error-handling portion of their input script. Another example is that some users prefer to use an EXIT command after explicit use of the LOGOFF command and use QUIT where a LOGOFF command has not used but sessions might still be logged on.

The EXIT command cannot be used in a Teradata SQL macro.

The maximum value supported for a return code can vary from one vendor's OS to another. This should be taken into consideration when changing default return code behavior to prevent BTEQ from returning possible corrupted values.

Example - EXIT

To exit BTEQ, type: