convert hex to integer

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
acool
Participant
Posts: 29
Joined: Tue Feb 17, 2004 4:31 pm

convert hex to integer

Post by acool »

Hi everyone,

I need to conver a hex number to an integer. Is there any built-in function in Datastage that does it? or I have to write my own funtion.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'll need to write your own, I'm pretty sure. Check the online help for the MY conversion code. It "Converts ASCII characters to hexadecimal values on input, and vice versa on output." - see if that will work for you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

At least two built-in functions.

DTX(n)

Iconv(n, "MX")

You can also use variants like Iconv(n, "MCD") and Iconv(n, "MCDX") - or maybe that last one's Iconv(n, "MCXD") - it's been a while since I played with them. Check out the DataStage BASIC manual or on-line help.

Enjoy!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Kind of an odd time for you to be posting Ray... airport lounge again? :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Still in India, coming up to 21:00.
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