Skip to Content
0
Former Member
Oct 17, 2005 at 11:58 PM

ASCII to EBCDIC packed decimal

691 Views

Hi everyone,

I need to convert some numerical string into a Package field in EBCDIC in order to write a file and send it to some mainframe system. I have using an ABAP proxy like sender and a File adapter like the reciver.

I have made some java function that takes every two characters and merge them into a single byte (like the mainframe can read it). I tested the function and evreything goes well in my PC, but when I create a simple user-defined function and try to make the conversion it writes the characters incorrectly.

But this only happen when the character are < 10.

I mean If I send a 999999 I have in my file ™™™œ This is correct becuase the hexadecimal representation is 99 99 99 9C.

But when I send 123456 I have in my mapping this string ##El but this is incorret because the hexadecimal code is <b>23</b> 23 45 6C and this should be #El hex: <b>01</b> 23 45 6C and I have this correct result when I run it in my PC.

does anybody have any idea why happens this???

or does anybody has another way to solve the problem of the packed fields???

I guess there is an internal conversion in the mapping, and cannot read the characters like 0000 0001.

I really appreciate your help

Thanks