BTEQ loop

Tools
Enthusiast

BTEQ loop

Is there a way(other than .run file) to use loops to perform an iteration in BTEQ and quit based on a condition?
2 REPLIES
Enthusiast

Re: BTEQ loop

I don't think that's possible, because even if you try to use some kind of logic and put a GOTO command to a previous label, it won't work as GOTO commands read labels only forward, it doesn't go back in the script and check.

You have the option of going for a stored procedure, but generally it's discouraged due to performance reasons. So your options would be to check if you can re-write the entire stuff as an SQL (teradata supports lots of complex SQL operations, including recursion).

Enthusiast

Re: BTEQ loop

Yes recursion might be a good idea