string to integer conversion

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
kalpanam
Participant
Posts: 39
Joined: Sat Apr 19, 2008 6:14 am

string to integer conversion

Post by kalpanam »

Hi,

Can any please let me know how to convert string to integer datatype.I know that Datastage implicitly convert the string datatype tp integer datatype without any external function but i'm not getting accurate data in the output.

For example:

I have cust_key(varchar(40) as input and its value 30066293603
and the output is coming as 2147483647 by giving cust_key(integer).

In the source i'm having 11digit value and in the output it is getting as 10digit value.

Please any of you let me know the solution.

Thanks & Regards,
Kalpana.
Kalpana Marupudi
rohithmuthyala
Participant
Posts: 57
Joined: Wed Oct 21, 2009 4:46 am
Location: India

Post by rohithmuthyala »

Make the output column datatype Bigint. It should solve your problem.!
Rohith
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The largest possible signed four byte integer is 2147483647. Unsigned integer can be twice this size only. Prefer to use eight byte integer (BigInt) if your values are larger than the limit allowed for four-byte.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply