Hi All,
I am trying to convert double to integer using the modify stage.
The source column is the output column from the aggregator stage that is defined as double with no length.
The output column from modify stage is integer(10,0).
I am using the following function in the modify stage.
output_column:int32=int32_from_decimal(input_column)
I get the warning as follows:
Mdy_Col: When checking operator: When binding output schema variable "outRec": When binding output interface field "input_column" to field "output_column": Implicit conversion from source type "dfloat"to result type "decimal[1,0]". [api/interface_rep.C:6170]
Please advice.
Thanks
Coversion of double to Int
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What you want to occur is happening. DataStage alerts you that what you are doing may not actually always work (some decimal numbers are too large to be represented as integers). You can use a message handler to demote this alert to an informational message or a NOWARN specification in your Modify stage.
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.
Re: Coversion of double to Int
It can be done in a transformer as well using AsInteger(%number%) function
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It's not an error.
It's an alert.
Not every decimal number, not every float number can be represented as an integer.
You need to be alerted to that fact, in case you don't know what you are doing.
Include a NOWARN specification in your Modify stage.
It's an alert.
Not every decimal number, not every float number can be represented as an integer.
You need to be alerted to that fact, in case you don't know what you are doing.
Include a NOWARN specification in your Modify stage.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: