Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

data type conversion( hexa to decimal)

Former Member
0 Kudos

when i am converting hexadecimal number "bdf" to decimal number .its giving me ans 189. but output should be 3039. how shd i remove this prob. here i am showing the code which i am using.

data value1 type x value 'BDF'.

data value2 type i.

move value1 to value2.

write value2.

2 REPLIES 2

Former Member
0 Kudos

HI ,

when i am converting hexadecimal number "bdf" to decimal number .its giving me ans 189. but output should be 3039. how shd i remove this prob. here i am showing the code which i am using.

data value1 type x value 'BDF'.

data value2 type i.

move value1 to value2.

write value2.

SHWETA

matt
Active Contributor
0 Kudos

Go into debug and check the value of "value1". You'll see your error quite quickly...

DATA value1 TYPE x LENGTH 2 VALUE '0BDF'.