BTEQ ERROR CODE .QUIT 66

Tools

BTEQ ERROR CODE .QUIT 66

Hi,

Could some help me out what is .quit 66 usage in the below statement.

.IF ERRORCODE <> 0 THEN .QUIT 66;

Thanks

balu

Tags (4)
2 REPLIES

Re: BTEQ ERROR CODE .QUIT 66

Hi Balu,

I guess Teradata will terminate the session/transaction and will exit BTEQ returning 66 to the operating system.  Using this code returned to operating system, you can frame the code accordingly.

Re: BTEQ ERROR CODE .QUIT 66

Logs off from Td Session.

Format is 

.QUIT n

ERRORCODE

ERRORLEVEL

ACTIVITYCO

Where n A decimal number specified as the job step return code.To avoid existing codes, do not use numbers from 1 to 10.

Example: 

So ,I can write in my code:

SELECT * FROM dbc.tables WHERE databasename='AVB';

.if errorcode <> 0 then .goto ERR

.if activitycount =  0 then .goto Lable1

.if activitycount <> 0 then CREATE TABLE ABC_bkp AS DEF WITH DATA;

.if errorcode <> 0 then .goto ERR

.quit 0

.label ERR

.quit 11

.label Lable1

.quit 21

Its use is for testing and branching.