On Fri, 16 Jan 2009 11:49:58 -0600, Kirk Wolf <[email protected]> wrote:

>John,
>
>You could write a simple Java program to convert from UTF-16LE to
>IBM-1047/IBM-037.
>Java supports UTF-16 encoding as its native encoding for characters, but
>uses a BOM to determine endian, whereas UTF-16LE does not.
>
>Not missing an opportunity to post *you* some code, here's some Java that
>should work ;-)
<snip>
>If you wanted to go to a dataset, you could use the JZOS ZFile class;
>otherwise you could run your program on either Windows or z/OS and FTP the
>file in binary.
>
>Kirk Wolf
>Dovetailed Technologies

Windows? Windows?? You accuse me of being a Windows user??? I tested it on
Linux, of course! <grin>

There is only one problem. Since the file was created on Windows, the line
ending is 0x0d0a. The resulting file is translated to EBCDIC, but the line
endings are 0x0d15. The "15" is correct, but the x'0d' needs to be removed
entirely. I guess I'll need to do that in the Java program before
converting. I'm going to take your advice and port it to use zFile in order
to suport z/OS legacy datasets. We don't use UNIX much on z/OS.

Oh, wait, I'll try on Windows too. Well, it failed due to not understanding
what IBM-1047 encoding is (UnsupportedEncodingException). This was with Java
1.6.0_03-b05.

--
John

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to