Because of the way the Teradata SQL compiler works, you CAST must the arguments of your expressions whenever large values are expected.
For example, suppose f1 is defined as DECIMAL(14,2) and you are going to multiply by an integer or get SUM(f1).
The following operations:
CAST(f1 AS DECIMAL(18,2))*100
or
SUM(CAST(f1 AS DECIMAL(18,2)))
are proper techniques for ensuring correct answer sets.
But if you cast the results of the expressions, such as the following:
CAST(f1*100 AS DECIMAL(18,2))
or
CAST(SUM(f1) AS DECIMAL(18,2)
overflow during the computations (and before the CAST is made) is likely—not the desired result.