Hi,
Searched for DecimalToDecimal, found few posts, but it isn't clear atleast for me, as I have to do the follwoing and struggling to get the right syntax [Transformer is what i'm using]
Field 1
Input Field : Decimal 12,1
Output Field Decimal 8,1
Field 2
Input Field: Decimal 12,0
Output Field: Decimal 9,0
Thanks,
Vijay
DecimalToDecimal conversion in Transformer
Moderators: chulett, rschirm, roy
DecimalToDecimal conversion in Transformer
Last edited by vijayrc on Fri Jan 11, 2008 8:16 am, edited 1 time in total.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You shouldn't need to do anything.
However DataStage will generate a warning to alert you that you can not fit all known Decimal(12,1) values into a Decimal(9,1) field.
If you know that you will be able to, because none of your Decimal(12,1) values has more than nine significant digits, then why not read the values in the first place as Decimal(9,1) - with a CAST, for example?
However DataStage will generate a warning to alert you that you can not fit all known Decimal(12,1) values into a Decimal(9,1) field.
If you know that you will be able to, because none of your Decimal(12,1) values has more than nine significant digits, then why not read the values in the first place as Decimal(9,1) - with a CAST, for example?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Yes..I'm getting Warnings, and I want to avoid those warnings instead of downgrading them to Informational, and hence this attempt.Maveric wrote:If you are sure that the input data will fit into Decimal 8,1 and Decimal 9,0 for fields 1 and 2 respectively, then you can directly map them from source to target. However DataStage will generate a warning. And you can suppress the warning to informational from the Director log.
Implicit conversion from source type "decimal[12,0]" to result type "decimal[9,0]": Possible range limitation.
Tried the following with Modify too, but it generates a warning:
Conversion from source type "decimal[15,2]" to result type "decimal[12,2]": Possible range limitation; rounding requested where no rounding possible.
New_Decimal_Field:Decimal[12,2] = decimal_from_decimal [round_inf] (Old_Decimal_Field)
Old_Decimal_Field is 15,2
New_Decimal_Field is 12,2
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Thanks Ray..That worked w/o a warning. But I have to introduce a Modify just for this in my stream. If you could suggest something in a Transformer, that would be great. I'm still trying on making transforming transformation of this decimal conversionray.wurlod wrote:Add an extra Specification to the Modify stage. This new Specification contains the single word NOWARN. ...
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I am unaware of any mechanism for preventing Transformer stage from generating warnings.
I had assumed, because you said "tried the following with Modify too" that you had a Modify stage in the job. Well, now you do. Leave it there - it doesn't eat much.
I had assumed, because you said "tried the following with Modify too" that you had a Modify stage in the job. Well, now you do. Leave it there - it doesn't eat much.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Thanks Ray for your input. I just tried having a Modify for this purpose, to eliminate the warning and to see if it works. Now that it works with your suggestion of NOWARN, I would either let it stay there just for warning suppression or go with Message Handler to suppress this warning.ray.wurlod wrote:I am unaware of any mechanism for preventing Transformer stage from generating warnings.
I had assumed, because you said "tried the following with Modify too" that you had a Modify stage in the job ...
Still hanging on to find a solution with a transformer as I have one along the way in my job stream
Thanks again for all your help inDS community