Hexadecimal to Char

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
anilkona
Participant
Posts: 50
Joined: Mon Nov 15, 2004 6:18 pm

Hexadecimal to Char

Post by anilkona »

I am trying to convert Hexadecimal value to Char.

The Hexadecimal value for example is in the format '4040404040404040F1F0F1F9' which is equivalent to ' 1019'.

I tried using OConv with codes "MCXD", "MCX".

Any ideas?

Thanks,
-Anil
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

The hex text you sent is EBCDIC (40 = space, F1 = '1', F0 = '0', F9 = '9'). In your import / Sequential Stage you should be able to automatically convert from EBCDIC to ASCII.
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Post by pnchowdary »

Hi Anil,

Convert from EBCDIC to ASCII using the Ascii( ) function. That should take care of your problem.

Thanks,
Naveen
anilkona
Participant
Posts: 50
Joined: Mon Nov 15, 2004 6:18 pm

Post by anilkona »

I tried ASCII() as well, it does not seem to work
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Post by pnchowdary »

Hi Anil,

Is your input column a COMP field or a regular field?
anilkona
Participant
Posts: 50
Joined: Mon Nov 15, 2004 6:18 pm

Post by anilkona »

No.its not a COMP field. When I imported metadata for that table, DataStage recognised it as Binary SQL Type.

-Anil
anilkona
Participant
Posts: 50
Joined: Mon Nov 15, 2004 6:18 pm

Post by anilkona »

When I use IConv with "MX0C" code, its returning "40404 "

The hexadecimal value I am trying to convert is "4040404040404040F1F0F1F9".

thanks,
-Anil
Post Reply