LOGOFF
Purpose
The LOGOFF command disconnects all active sessions and terminates execution of Teradata TPump on the client. An optional return code value may be specified as a conditional or arithmetic expression, evaluated to a signed integer.
Syntax
where
Syntax Element |
Description |
retcode |
Completion code returned to the client operating system If retcode is not specified, Teradata TPump returns the value generated by the error condition. |
Usage Notes
Teradata TPump tracks the internal error condition code throughout the job and returns either 0 for complete success, 4 for warnings, 12 for fatal errors, and 16 for no sysprint. These values are the “error conditions”.
To avoid ambiguity or conflict with standard Teradata TPump completion codes, values greater than 20 should be used. Teradata TPump returns the higher value between the value generated by the error condition and the return code specified in LOGOFF.
If the LOGOFF command processes, this indicates that the highest return code reached was no more than 4 (warning). Any return code other than 0 or 4 would have terminated the job.
LOGOFF is permitted at any point in the input script and logs off immediately.
Example
Suppose successful execution of a Teradata SQL statement (such as CREATE TABLE) is necessary to prepare for Teradata TPump. If it is determined that the statement has failed with an unacceptable completion code, and if BADRC is set to &SYSRC after the failed SQL statement, the execution of Teradata TPump can be terminated and the unacceptable code returned to the client by executing this command:
.LOGOFF &BADRC;
The restart table is dropped when this command is executed. If execution is terminated before the LOGOFF command is encountered, the restart table is not dropped, in order to support a restart at a later time.
If a serious error terminates the program before the LOGOFF command is processed, the return code output is the value generated by the error condition rather than the optional retcode specified as a LOGOFF command option.