Bteq if then condition

435 views Asked by At

I have a Bteq script file which contain multiple queries like below:

Bteq

Quer1;
Quer2_a;
Quer2_b;
Quer3;
Quer4;
.if errorcode <> 0 then .goto end_err

.label end_ok
.quit 0

.label end_err
.quit 9

FIN
exit $?

Here I want to put a conditional expression if then So if my condition is satisfied (current_date - tec_date > 1 year) then the quer2_a will be executed and the the quer2_b will be ignored then the script execute the other queries 3,4

if the condition is not satisfied the quer2_a will be ignored and the quer2_b,3,4 will be executed.

the queries 1,3 and 4 are independent of the condition.

0

There are 0 answers