In teradata proc sql in SAS Enterprise guide environment, I am trying to create a column by multiplying two fields, but I have been having overflow issue. How do I specify the number of decimals in the resulting field during Select statment? numeric(20,2)
proc sql exec feedback stimer;
connect to teradata as teravw (authdomain=teradataauth TDPID=DWPROD2 MODE=TERADATA SCHEMA=EDW_NOPHI CONNECTION=GLOBAL);
CREATE TABLE WORK.tbl1 AS
SELECT * from connection to teravw
(SELECT
...
,case
when PCL.CLM_SOR_CD = '512' then cast(round(sum(PCL.PRCG_WHLSL_ALWBL_COST_AMT * CL.PAID_SRVC_UNIT_CNT) ,0.01) as numeric(20,2))
else SUM(PCL.PRCG_WHLSL_ALWBL_COST_AMT)
end AS WAC
...
);
disconnect from teravw;
quit;
run;
error message:
ERROR: Teradata row not delivered (trget): Numeric overflow occurred during computation.