DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
wfis



Group memberships:
Premium Members

Joined: 28 Feb 2007
Posts: 70
Location: India
Points: 527

Post Posted: Fri Oct 31, 2008 7:20 am Reply with quote    Back to top    

DataStage® Release: 7x
Job Type: Parallel
OS: Unix
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
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54398
Location: Sydney, Australia
Points: 295054

Post Posted: Fri Oct 31, 2008 9:12 am Reply with quote    Back to top    

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 messa ...

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
currently hiring: Canberra, Sydney and Melbourne (especially seeking good business analysts)
Rate this response:  
Not yet rated
ajmore
Participant



Joined: 25 Aug 2006
Posts: 22

Points: 210

Post Posted: Fri Oct 31, 2008 1:53 pm Reply with quote    Back to top    

It can be done in a transformer as well using AsInteger(%number%) function
Rate this response:  
Not yet rated
wfis



Group memberships:
Premium Members

Joined: 28 Feb 2007
Posts: 70
Location: India
Points: 527

Post Posted: Mon Nov 03, 2008 8:09 am Reply with quote    Back to top    

I earlier used transformer stage only to do this. But when it was possible for a modify stage do it, I changed it.

I am not sure why DataStage gives this error when it is performing the same function.

Thanks.
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54398
Location: Sydney, Australia
Points: 295054

Post Posted: Mon Nov 03, 2008 10:31 am Reply with quote    Back to top    

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 ...

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
currently hiring: Canberra, Sydney and Melbourne (especially seeking good business analysts)
Rate this response:  
Not yet rated
BSridhar
Participant



Joined: 25 May 2018
Posts: 4

Points: 19

Post Posted: Mon Jul 30, 2018 12:17 pm Reply with quote    Back to top    

Hi,

I am also having the same issue. Unable to convert from double to int by using Modify stage. How can we get rid if this warning? There is no length/scale passed in my input columns.
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 42765
Location: Denver, CO
Points: 220367

Post Posted: Mon Jul 30, 2018 12:46 pm Reply with quote    Back to top    

Which same issue? Are you just asking about the warning message or are the conversions actually failing?

_________________
-craig

Research shows that 6 out of 7 dwarves aren't happy
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54398
Location: Sydney, Australia
Points: 295054

Post Posted: Tue Jul 31, 2018 8:16 pm Reply with quote    Back to top    

We use AsInteger() for this conversion, in the knowledge that none of our Double values is out of range for Integer data type.

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
currently hiring: Canberra, Sydney and Melbourne (especially seeking good business analysts)
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours