Convert Hexadecimal String to Integer

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
sharma
Premium Member
Premium Member
Posts: 46
Joined: Mon Dec 24, 2007 2:16 pm

Convert Hexadecimal String to Integer

Post by sharma »

Hi,

Can anybody please tell me how do i convert hexadecimal string to integer/bigint.
Is there any inbuilt function available for this conversion in Datastage?
Nirmal Sharma
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could use a BASIC Transformer stage and there employ the Oconv() function with "MX0C" as its second argument.

I don't believe there's an out-of-the-box function in the parallel Transformer, but there's nothing to stop you writing your own. Traverse the string from right to left multiplying each hex digit by the appropriate power of 16 and accumulate the result.
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