COBOL Question - UNICODE -
we looking convert our legacy cobol code ansii unicode have come across problem changing pic x fields pic n , setting nsymbol(national) cause problems when data structures contain redefines or rename statement elementary data items using pic 9 fields.
01 ws-record pic n(26). 01 ws-record-1 redefines ws-record. 02 ws-num pic 9(6). 02 ws-data pic n(20). move n"123456abcdefghijklm" ws-record.
in above string being moved in utf-16 format, therefore field ws-num corrupt contain x"310032003300" invalid numeric, ws-data contain x"3400350036004100..etc
the question is, when using national (utf-16) data types how can numerics handled correct data after has been redefined.
i can sort of work doing following invalid data in other ws-record.
move 123456 ws-num. move n"abcdefghijklm" ws_data.
the above correct, if examine ws-record see ???abcdefghijklm ??? x"313233343536" in hexi-decimal.
our problem have multiple data records depending on record type identifier, use redefines on many of our linkage items.
has had experience moving legacy ascii unicode?
02 ws-num pic 9(6) usage national.
should work (at least on ibm compilers).
Comments
Post a Comment