Skip to main content
M Carmen De Paz
Participating Frequently
Feb 3, 2026 6:21 PM UTC
Question

Left shift of fields in file when the previous field contains a utf8 character

Hi ,we works with Micro Focus Visual cobol 8.0 for Eclipse on linux/Unix

We have a program  with a file that we defines so:

file-control.

     select prevcob    assign to wk-prevcob

     organization is line sequential.

data division.

file section.

fd prevcob.

01  reg-prevcob               pic x(185).

and a working variable that defines the file structure as follows:

01 wk-reg-prevcob-pru.

    10 prevcob-nombre-pru            pic x(40)      value spaces.

    10 prevcob-impdivisa-pru         pic 9(16)v99   value 0.

    10 resto                         pic x(127).

We define a cusor that obtains data from a database with UTF-8 locales in Informix and passes it to the variables of the working (the host variable are defined like pic x(300) and pic s9(16)v9(2))

move clinombr                    to prevcob-nombre-pru

move srvimpdivi                  to prevcob-impdivisa-pru

 we write the file as follws:

write reg-prevcob from wk-reg-prevcob-pru

The problem is that when field prevcob-nombre-pru contains a utf8 character, field prevcob-impdivisa-pru  appears to  shift one position to the left and the file becomes misconfigured.this is a image of dthe file edited with VI editor

The file is in a directory of the server unix.

 

¿is it possible that the file appears alingned?

 

 

 

11 replies

Chris Glazier
Moderator
Feb 9, 2026 1:47 PM UTC

I am happy that the iconv program worked for you!

Please start a new discussion, so that it doesn’t get lost in this one, and specify exactly what problem you are trying to solve using the cobutf8 utility.

Thanks