I have data coming in character format like 98789.99. After reading this, i need to sum up all these values in Aggregator stage. For that i tried modify stage to convert string to decimal. i got the error as below
Modify_319: When checking operator: When binding output schema variable "outRec": When binding output interface field "Filed_Name" to field "Filed_Name": Conversion from source type "string[9]" to result type "decimal[1,0]": Possible range limitation.
You need to mention the Length and scale in modify stage output metadata as otherwise it will take the default value. The error is because the incoming data is of length 9 and you have not mentioned any length or scale in the modify stage metadata
I have changed it in Transformer and not its fine.
But i am facing one more issue that After Aggregation i used modify stage to convert double to decimal using default like Column_Name=Column_Name. It is giving the proper result, but its not adding zeros after decimal point if the data is rounded eg: 100.00 it is showing only 100, 100.10==>100.1.
Yes, but remember that leading and trailing non-significant zeroes are not actually part of a Decimal number. Therefore, the display specifications are applicable only when the target data type is string. You could try applying a DecimalToDecimal() function with scale of 2 in the metadata.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I am using below syntax in modify stage to keep 2 decimal places as scale. Even it is 00 it should as 00.00
I used syntax as:
Total_Record_Count = DecimalToDecimal(Total_Record_Count,"round_inf")
I am getting error like:
Error parsing modify adapter: Error in binding: Unknown conversion: DecimalToDecimal
Expected destination field selector, got: ")"; input:
Total_Record_Count = DecimalToDecimal(Total_Record_Count,"round_inf")
Input is decimal format and output also decimal format