We're in the process of updating our COBOL programs running on an IBM Mainframe (z/OS) to support non-latin characters.
I'm struggling a bit with understanding how COBOL processes UTF-16 characters defined as PIC N.
I need to update a field currently defined as PIC X to PIC N. This field then gets written to a file.
Example:
01 RecordToWrite PIC X(20).
I understand PIC N needs twice as much space as PIC X. What I don't know is how to define the corresponding PIC N field.
My guess would be COBOL takes care of the conversion itself:
01 RecordToWrite PIC N(20).
But I'm really not sure if it's that simple.
Can I just simply define the old field as PIC N without having to worry that my file still looks the same? Which measures do I need to take?