Page 1 of 1

Fatal Error: APT_Decimal::asInteger: the decimal value is ou

Posted: Fri Jun 13, 2008 10:42 am
by ureddy
Hi all,

My job is getting aborted by showing the below Fattel error.

Fatal Error: APT_Decimal::asInteger: the decimal value is out of range for the integer result.

In the transformer im converting all the decimal fields to string. im not using any integer datatype in the target.

The same job is working fine in DEV,but its giving the above Fatal error in the UAT environment.

Any suggestions please?

Following is the log from UAT environment.

Message :
main_program: Waiting for step completion.
Event Id: 32
Time : Fri Jun 13 10:52:30 2008
Type : FATAL
User : dsadm
Message :
AstGrpCd_NotIn_WP_Fmt_Tfm,0: Failure during execution of operator logic.
Event Id: 33
Time : Fri Jun 13 10:52:30 2008
Type : INFO
User : dsadm
Message :
AstGrpCd_NotIn_WP_Fmt_Tfm,0: Input 0 consumed 15 records.
Event Id: 34
Time : Fri Jun 13 10:52:30 2008
Type : INFO
User : dsadm
Message :
AstGrpCd_NotIn_WP_Fmt_Tfm,0: Output 0 produced 14 records.
Event Id: 35
Time : Fri Jun 13 10:52:30 2008
Type : FATAL
User : dsadm
Message :
AstGrpCd_NotIn_WP_Fmt_Tfm,0: Fatal Error: APT_Decimal::asInteger: the decimal value is out of range for the integer result.
Event Id: 36
Time : Fri Jun 13 10:52:30 2008
Type : FATAL
User : dsadm
Message :
node_node1: operator [APT_TransformOperatorImplV42S1_MDB_MS_SLH_Extract_Reformat_Job_AstGrpCd_NotIn_WP_Fmt_Tfm in AstGrpCd_NotIn_WP_Fmt_Tfm], partition 0 of 4, processID 5270 on node1, player 29 terminated unexpectedly.
Event Id: 37
Time : Fri Jun 13 10:52:30 2008
Type : FATAL
User : dsadm
Message :
main_program: Unexpected exit status 1
Event Id: 38
Time : Fri Jun 13 10:52:31 2008
Type : INFO
User : dsadm
Message :
main_program: Releasing Section Leaders; parallel step time was 5705.83 seconds.
Event Id: 39
Time : Fri Jun 13 10:52:36 2008
Type : FATAL
User : dsadm
Message :
main_program: Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Unexpected exit status 1
Event Id: 40
Time : Fri Jun 13 10:52:36 2008
Type : INFO
User : dsadm
Message :
main_program: Returning step status of APT_StatusFailed.

Posted: Fri Jun 13, 2008 3:49 pm
by ray.wurlod
Your source data in the UAT environment contains a decimal number larger that the largest permissible integer (2147483647).

Posted: Mon Jun 16, 2008 11:00 am
by ureddy
Hi Ray,

but im converting all the decimal fields to strings. Eventhough the length of the decimal field is larger from the source iam converting decimals to string.
Iam putting the following logic for the decimal columns.

1)the field from source is : -(SHRPAR_QTY_SUM) decimal [31,11]

In Tfm iam converting to string as below.

If IsNotNull(Rec_Out_Lnk.SHRPAR_QTY_SUM)
Then If Rec_Out_Lnk.SHRPAR_QTY_SUM < 0
Then ('-' : Right(Str('0',12) : Field(DecimalToString(Abs(Rec_Out_Lnk.SHRPAR_QTY_SUM), 'fix_zero,suppress_zero'), '.', 1), 12)
: '.' : Left(Field(DecimalToString(Rec_Out_Lnk.SHRPAR_QTY_SUM, 'fix_zero'), '.', 2) : Str('0', 3), 3))
Else (' ' : Right(Str('0',12) : Field(DecimalToString(Abs(Rec_Out_Lnk.SHRPAR_QTY_SUM), 'fix_zero,suppress_zero'), '.', 1), 12)
: '.' : Left(Field(DecimalToString(Rec_Out_Lnk.SHRPAR_QTY_SUM, 'fix_zero'), '.', 2) : Str('0', 3), 3))
Else Str(' ',1) : Str('0',12) : "." : Str('0',3)

target field
SHRPAR_QTY_SUM varchar 17

The output should be that i have to get in target is
-0000000261014.94
0000000045212.54
0000000357570.12
-0000000036601.93

If value comes -ve then - sign will b preceeds the value otherwise a single space will preceeds the value.

Iam getting the proper output as specified above in DEV, but the job is getting aborted as stated in the previous post.

2)For the source column DAYS_TOMAT_CNT Bigint 10
In Tfm im putting the following logic to convert to varchar

Right(Str('0',5):NullToZero(Rec_Out_Lnk.DAYS_TOMAT_CNT), 5)

Target column DAYS_TOMAT_CNT varchar 5

Can you please suggest me which column is causing the problem?

Posted: Wed Jun 18, 2008 11:50 am
by ureddy
Hi,
I got the solution. :D .
The error is due to the Abs() function.

Abs( ) function returns an integer value. So, code is failing since, SHRPAR_QTY_SUM is a decimal value and we were trying to convert an integer to a string with an incorrect type conversion function and the values coming from UAT environment is larger than the int32 size(2^32-1). so the job was failing in UAT env.

so i modified the logic.instead of Abs() i uesd Trim function to cut the -ve sign from the values.

If IsNotNull(Rec_Out_Lnk.SHRPAR_QTY_SUM)
Then If Rec_Out_Lnk.SHRPAR_QTY_SUM < 0
Then ('-' : Right(Str('0',12) : Field(Trim(DecimalToString(Rec_Out_Lnk.SHRPAR_QTY_SUM), 'fix_zero,suppress_zero'),'-','L'), '.', 1), 12)
: '.' : Left(Field(DecimalToString(Rec_Out_Lnk.SHRPAR_QTY_SUM, 'fix_zero'), '.', 2) : Str('0', 3), 3))
Else (' ' : Right(Str('0',12) : Field(DecimalToString(Abs(Rec_Out_Lnk.SHRPAR_QTY_SUM), 'fix_zero,suppress_zero'), '.', 1), 12)
: '.' : Left(Field(DecimalToString(Rec_Out_Lnk.SHRPAR_QTY_SUM, 'fix_zero'), '.', 2) : Str('0', 3), 3))
Else Str(' ',1) : Str('0',12) : "." : Str('0',3)