Kirk, As I think I said in a prior reply, I am happy to have an LE ERROR condition handle the case of an improperly coded UTF-8 character anywhere in a string, and as for the case of no EBCDIC character defined, I am also happy to have the system always use the SUB character. All of which the already-defined DISPLAY-OF + NATIONAL-OF intrinsic functions implement.
Yes, I was in fact able to get CUNLCNV working from COBOL as a dynamically called subroutine. I only had to manually translate two PL/X control structures into COBOL to do that, ignoring the BIT variables in the PL/X version and just defining those areas as PIC X. Testing or setting any of the BIT variables wasn't necessary to get the desired behavior of translating between CCSID's supported by the system Unicode setup. I admit I did not test this with an improperly code UTF-8 character in the string to see the ERROR condition raised, but for correctly formed UTF-8 strings it "just works". I am not going to use the CUNLCNV setup for the project I am working on for my employer since the DISPLAY-OF + NATIONAL-OF solution is far simpler and is supported. Peter From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Kirk Wolf Sent: Saturday, January 3, 2026 1:41 PM To: [email protected] Subject: Re: Please vote for COBOL "idea" for reverse character translation Peter, I would assume that IBM didn't implement UTF-8 -> EBCDIC "MOVE" conversions because of the issues: - What if the source field ended in the middle of a UTF sequence? Error or Subsitute char? - What if there is no EBCDIC character defined? Error or Substitute char? Were you able to get CUNLCNV working from COBOL? You could roll your own with that and control how you wanted it to behave. Besides, by the time IBM adds it to COBOL you won't need it any more :-) Kirk Wolf Dovetailed Technologies https://urldefense.com/v3/__https://coztoolkit.com__;!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!LcQB_YQUhf9YoXH3Oq9y1iysiGDEoxM2F6IDNWMlQW8HD7q3eLc0O_X1GqbX9M9rX-W5wsP5bx0iw3RnGVywQQ$ On Fri, Jan 2, 2026, at 6:18 PM, Farley, Peter wrote: > Following up on my own post to expand a little on my reasoning: The current > implementation of at least UTF-8 to EBCDIC character conversion is ALREADY IN > PLACE as part of the JSON PARSE statement. I am just asking them to move > that logic into MOVE operations as well. I actually don't care about the > NATIONAL character class as I currently have no business use for it, but I > included NATIONAL to keep the "idea" more general. I'd be satisfied if the > NATIONAL part was rejected and the UTF-8 part was accepted. > > Peter > > From: IBM Mainframe Discussion List <mailto:[email protected]> On > Behalf Of Farley, Peter > Sent: Friday, January 2, 2026 1:56 PM > To: mailto:[email protected] > Subject: Please vote for COBOL "idea" for reverse character translation > > Currently Enterprise COBOL allows PIC X alphanumeric EBCDIC group and > elementary items to MOVE to UTF-8 (PIC U) and NATIONAL (PIC N) group and > elementary items with automatic character set translation, but the reverse > MOVE is not allowed. There is no technical reason why the reverse MOVE > should not be allowed, since the character set translation logic is already > in place for a PIC X MOVE into PIC U and PIC N. > > I have a bit more detail on the subject in the "idea" summary, please read > those details at the "ideas" page and vote for it. > > https://urldefense.com/v3/__https://ideas.ibm.com/ideas/COBOLVUE-I-427__;!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!IAZEw5W2hk89dBIvLyXiwP3dYk-UdzHzB5EPYEoZ0vUZ8IEF6lk9vTHOs79jtzHYF-2mFkJc1fKGGf4rp_t_4JhI6-h9W-oR3nsh0dHa$> > TIA for your votes. > > Peter -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
