Page 1 of 1

Conversion of Hex Value to equivalent Decimal & ASCII Va

Posted: Wed Jul 08, 2009 4:26 am
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.

Posted: Wed Jul 08, 2009 4:34 pm
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.

Posted: Thu Jul 09, 2009 5:11 am
by Gokul
Thanks Ray!

This is helpful

Posted: Thu Jul 09, 2009 4:14 pm
by ray.wurlod
Unfortunately I have no TX skills so can't advise how to contruct the map to manage the conversions.

Posted: Wed Jul 15, 2009 8:49 am
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.

Posted: Wed Jul 15, 2009 10:02 am
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.