BTEQ error Failure 2662

Tools & Utilities

BTEQ error Failure 2662

Hi everyone,

I am getting this cryptic error when running a simple select using bteq:

*** Failure 2662 SUBSTR: string subscript out of bounds.
Statement# 1, Info =0

It runs fine in my dev area but blows up in production. Anyone have any ideas?



Re: BTEQ error Failure 2662

Just what the message says. Here is the explanation from the "Teradata Database Messsages" document.

2662 SUBSTR: string subscript out of bounds.

Explanation: This error occurs when a SUBSTR is
used, and either the start position used is beyond the
end of the string, the start offset plus the specified
length is greater than the string length, or the specified
length is negative.

Generated By: The interpretative instruction processor.

For Whom: End User.

Notes: This can be caused by an error in the second or
third argument of SUBSTR.

Remedy: Fix the DBC/SQL request and resubmit