Re: tofile 1.1.2 fails on iconv request

Posted: Mon Nov 24, 2014 11:06 am

by john.mckown

I didn't notice the source page being ISO-8859-1 instead of ISO8859-1. If I enter the Linux command: export COZ_CLIENT_CODEPAGE=ISO8859-1 before doing the tofile, it works fine. I don't know where the ISO-8859-1 is coming from. The iconv on z/OS 1.12 (and 2.1) will accept ISO8859-1 but not ISO-8859-1.

Re: tofile 1.1.2 fails on iconv request

Posted: Mon Nov 24, 2014 11:42 am

by john.mckown

Don't you just hate it when you find the "problem" a short time _after_ asking for help? Apparently this is a related to the locale on my Linux system. I have it set up as the "C" language, but looking at:

Shows the problem. No ISO8859-1 in that, but the problematic ISO-8859-1.

Re: tofile 1.1.2 fails on iconv request

Posted: Mon Nov 24, 2014 12:08 pm

by john.mckown

Well, I'm still running off at the keyboard (vice mouth). It turns out that ISO8859-1 is _NOT_ valid at all according to IANA (ref: https://www.iana.org/assignments/charac ... sets.xhtml) ISO-8859-1 has some aliases, but ISO8859-1 is not one of them. Too bad IBM (and Microsoft who apparently also uses ISO8859-1 at times) don't need to be bothered with standards. I'm going to use the COZ_CLIENT_CODEPAGE environment variable and mutter under my breath about IBM and MS.

Penguinista and Proud!
John McKown

Re: tofile 1.1.2 fails on iconv request

Posted: Mon Nov 24, 2014 4:43 pm

by dovetail

What is happening is that the default client codepage is taken from the current locale. This can be overridden using the *client* environment variable: COZ_CLIENT_CODEPAGE).
The actual codepage conversion is done on z/OS.

You can also add name mappings by using the following z/OS environment variable:
export COZ_TRSUB_ISO-8859-1=ISO8859-1

Also, the iconv reason code (which we should really be printing in hex) is this:

zos$ bpxmtext C22C001C
JrEdcIcntEinval16: The from CCSID cannot be determined.
Action: The from converter name is invalid. Fix it and try again.

And we can confirm that z/OS iconv_open() doesn't know about ISO-8859-1 -

Re: tofile 1.1.2 fails on iconv request

Posted: Tue Nov 25, 2014 8:32 am

by john.mckown

Thanks for the update. I'm using the COZ_CLIENT_CODEPAGE on my Linux system. I also reported this error on IBM's part on the MVS-OE forum, just so that others would know of it. I no longer put in problem reports to IBM because I no longer have access to IBMLink (false economy, IMO) and so cannot open an ETR or PMR on line. As to whether to put in a "fix" in your code to change ISO- to ISO if iconv() fails, I defer that decision to your greater knowledge. "It is better to light a flamethrower than curse the darkness" ... or something like that.