DATA Step, Macro, Functions and more

Find which variable is causing Teradata Numeric Overflow error

Reply
Contributor
Posts: 38

Find which variable is causing Teradata Numeric Overflow error

ERROR: Teradata row not delivered (trget): Numeric overflow occurred during computation.

 

I have ~300 variables in this data, at least one of them is causing this error.  Without pulling one by one, or something like that, how can I identify which variable is the one causing this problem?

 

It's a teradata database, being read with proc sql in EG 9.4

 

Thanks

Super User
Posts: 13,920

Re: Find which variable is causing Teradata Numeric Overflow error

Examine the variables in the Teradata source for characteristics that indicate large or small values like DOUBLE precision, extended precision or some such (I don't speak Teradata).

You apparently are doing something with a computation. Look for computations involving any of those variables. Perhaps either use pass through code an execute in Teradata then move the results to SAS or move the data to SAS prior to the computations.

Regular Contributor
Posts: 230

Re: Find which variable is causing Teradata Numeric Overflow error

Make sure you're using explicit passthru with Teradata SQL instead of implicit passthru with SAS SQL.
Super User
Super User
Posts: 8,272

Re: Find which variable is causing Teradata Numeric Overflow error

[ Edited ]

The surprising thing to me was that simple counts can cause that error, depending on whether you are using TERADATA or ANSI mode.

 

We needed to use explicit passthru and cast the count as BIGINT, or better for working with SAS as FLOAT.

proc sql ;
  connect .... ;
  select * from connection to teradata 
(select cast(count(*) as float) as nobs
  from mydb.mytable
);
quit;

 

Contributor
Posts: 38

Re: Find which variable is causing Teradata Numeric Overflow error

I appreciate all of the replies, but none of the responses answered the question.

Regular Contributor
Posts: 230

Re: Find which variable is causing Teradata Numeric Overflow error

If you're summing a smallint, that's one likely cause. The result wouldn't fit in a smallint.  Cast to decimal or float.

Ask a Question
Discussion stats
  • 5 replies
  • 123 views
  • 0 likes
  • 4 in conversation