Conversion of Hex Value to equivalent Decimal & ASCII Va

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
Gokul
Participant
Posts: 74
Joined: Wed Feb 23, 2005 10:58 pm
Location: Mumbai

Conversion of Hex Value to equivalent Decimal & ASCII Va

Post by Gokul »

I have the Hexa Decimal input and need to convert it into its corresponding Decimal value & ASCII Value. I am interpreting the input hex value as "Character" i.e. Item Subclass is 'Text' & Interpret as 'Character'.

Ex: 44 48 47 33 31 55 37 37 31 39 30 30 39 33 31 00. This is input hexa decimal value(16 Bytes).

Need to get the output as Decimal & ASCII values.

Decimal Equivalent: 3546919165207195600


Do I need to change the Interpretation method in the output item in the type tree or any functions in the map designer to handle this?

Can anyone help out in this regard?

Thanks
Gokul.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I suspect what you may need to get out of that is the character associated with each hex byte. For example, 44 is ","; 48 is "0"; and so on.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Gokul
Participant
Posts: 74
Joined: Wed Feb 23, 2005 10:58 pm
Location: Mumbai

Post by Gokul »

Thanks Ray!

This is helpful
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Unfortunately I have no TX skills so can't advise how to contruct the map to manage the conversions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jvmerc
Participant
Posts: 94
Joined: Tue Dec 02, 2003 12:57 pm

Post by jvmerc »

If your type tree is defined correctly you should be able to simply point the new field at the old field and run your map. Your output will be in the format you require.
manniej
Participant
Posts: 6
Joined: Fri Jul 10, 2009 10:34 am

Post by manniej »

I think you should read the input field as binary and it could either be float or packed decimal depending on how the source created it (mainframe I assume) then to convert it into ascii you will need HEXTEXTTOSTREAM function. I hope this will help.
Post Reply