Hi,
bteq <<!
.set session transaction BTET;
.run file=$HOME/.tdlogon
.set errorout stdout;
.set maxerror 2;
.set width 65000;
.set titledashes off;
.set errorlevel on;
DELETE FROM UD466.FF_ACTIVE_INTAKE;
.IF ERRORCODE = 0 THEN .GOTO ACTIVEREC; /*table existed so got errorcode zero*/
.IF ERRORCODE <> 0 THEN .GOTO FINISH;
.IF ERRORCODE=3807 THEN .GOTO NextLBL;
.LABEL NextLBL
CREATE MULTISET TABLE UD466.FF_ACTIVE_INTAKE AS
(SEL * FROM
UD466.FF_INTAKE_REQS
WHERE FINAL_FF_REQUEST_DT >= CURRENT_DATE
AND UPPER(TRIM(FF_EXEC_STATUS)) = 'ACTIVE'
QUALIFY ROW_NUMBER() OVER (PARTITION BY ERNI_CAMPAIGN_NUMBER, PROMO_CD
ORDER BY LOAD_TIMESTAMP DESC) = 1)
WITH DATA
PRIMARY INDEX (LOB ,ERNI_CAMPAIGN_NUMBER, PROMO_CD);
Problem is when there is no table its just throwing the below error and going to the
DELETE FROM UD466.FF_ACTIVE_INTAKE;
*** Failure 3807 Object 'UD466.FF_ACTIVE_INTAKE' does not exist.
Statement# 1, Info =0
*** Exiting BTEQ...
*** RC (return code) = 8
Please let me know why this Label thing is not working.
Forums: