All Forums Tools
balu_td 22 posts Joined 03/13
10 Jan 2014
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

chill3che 99 posts Joined 10/12
10 Jan 2014

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.
 

Thanks,
Cheeli

Raja_KT 1246 posts Joined 07/09
10 Jan 2014

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.

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

You must sign in to leave a comment.