Converting BigInt(Int64) to Integer(Int32) 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
prashanthgovindaraj
Participant
Posts: 13
Joined: Tue Oct 30, 2007 8:33 am
Location: Chennai

Converting BigInt(Int64) to Integer(Int32) in Modify Stage

Post by prashanthgovindaraj »

Can i have the syntax/example for Converting BigInt(Int64) to Integer(Int32) in Modify Stage.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

OutputColumn:int32=InputColumn 
or

Code: Select all

OutputColumn:nullable int32=InputColumn
Input column is of data type int64. This will generate "possible loss of precision" warning. You can create an additional specification containing just the single token NOWARN to suppress the warnings: this is probably not a good idea - what if one of the int64 values is larger than 2147483647 (the largest possible int32) or smaller than -2147483648 (the smallest possible int32)?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prashanthgovindaraj
Participant
Posts: 13
Joined: Tue Oct 30, 2007 8:33 am
Location: Chennai

Post by prashanthgovindaraj »

ray.wurlod wrote:

Code: Select all

OutputColumn:int32=InputColumn 
or

Code: Select all

OutputColumn:nullable int32=InputColumn
Input column is of data type int64. This will generate "possible loss of precision" war ...

I get a warning when i tried to implement the idea. The warning needs to be avoided. What needs to be done here??
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read the remainder of my post, which deals with suppressing the warning.

Premium membership costs less than 30c (Rs12) per day. These funds are totally devoted to assisting with the hosting and bandwidth costs incurred by DSXchange. It is a worthwhile investment.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
krishnakumar_m16
Premium Member
Premium Member
Posts: 5
Joined: Tue Oct 09, 2007 6:29 am
Location: Chennai

Post by krishnakumar_m16 »

Give the specification in the modify stage as given above and change the Integer Datatype to BigInt Datatype in the column metadata definition.
Krishna Kumar Bhaskaran
Post Reply