data type convertion in modify stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
lakshmipriya
Participant
Posts: 31
Joined: Tue Jul 13, 2004 5:26 am
Location: chennai
Contact:

data type convertion in modify stage

Post by lakshmipriya »

hi
I want to convert a column from the datatype decimal(10,0) to integer without any warnings using a modify stage.

I tired to use the function "int32_from_decimal" but its returing rows with warning.

When checking operator: When binding output schema variable "APT_TRoutput0Rec0": When binding output interface field "NUMBER" to field "NUMBER": Conversion; from source type "decimal[10,0]" to result type "int32": Possible range limitation




How can i do this, give me some suggestions
Lakshmi
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

Hi lakshmipriya ,


Please check datatype in the previous modify stage.


Thanks
Man
kura
Participant
Posts: 21
Joined: Sat Mar 20, 2004 3:43 pm

Re: data type convertion in modify stage

Post by kura »

Try with int64_from_decimal, and declare you out data type as bigint instead of integer.

Vijay
waitnsee
Participant
Posts: 23
Joined: Tue Jul 06, 2004 10:20 am

Post by waitnsee »

If you are converting from decimal(10,0) to integer, its more like integer to integer, thats why its giving you a binding error.
Decimal (10,0) is nothing but a 10 digit integer with no decimal spaces. So, you can declare the field itself as integer of 10.
Let me know if that works !!!
kura
Participant
Posts: 21
Joined: Sat Mar 20, 2004 3:43 pm

Post by kura »

Eventhough it is binding error, if read till the end of sentence, you will range limitation error. Because in the PX I orbserved that if have input 10 digit integer data type will not accept. You have declare as Bigint.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not every ten digit number is an integer.
The largest (four byte (32 bit)) signed twos-complement integer is 2147483647; the largest unsigned is 4294967295.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kura
Participant
Posts: 21
Joined: Sat Mar 20, 2004 3:43 pm

Post by kura »

[quote="ray.wurlod"]Not every ten digit number is an integer.
The largest (four byte (32 bit)) signed twos-complement integer is 2147483647; the largest unsigned is 4294967295.[/quote]

yes you are right. If there is data coming wiht 3123456789, then obviously int32 will not accept.

vijay
lakshmipriya
Participant
Posts: 31
Joined: Tue Jul 13, 2004 5:26 am
Location: chennai
Contact:

Post by lakshmipriya »

Hi

Thanks for your suggestions, now its work fine.
I changed the input length from 10 to 9 so that it converts decimal(9,0) to integer

Thank U
Lakshmi
Post Reply