COBOL issue

Hi,

I am working on a Mainframe to UNIX replatforming project.
we are facing problems with COBOL COMP-3 fields. We are using the Mainframe emulator software to download the data which has COMP-3 fields and using it as input to the same COBOL programs which were copied from Mainframe and did the required changes to make it compatible to UNIX environment. when we tried to read the data, the COMP-3 fields are taking extra bytes data from other fields.

For example,

FIELD1 of COMP-3 type takes 4 bytes in Mainframe
FIELD2 of COMP-3 type takes 5 bytes in Mainframe

But when used in UNIX,

FIELD1 data has shown as 2 bytes in pysical file and since it occupies 4 bytes rest of the 2 bytes it is conceiving from the rest of the record. so obviously next field FIELD2 will have lost first two bytes of its data and hence it takes 5 bytes from the rest of the record.

Please suggest how to overcome this problem.

Thanks,
JP

Hi,

I would like to know whether it takes extra byte in UNIX for COMP-3 fields compared to Mainframe. Please advice.

I have run same program in UNIX and Mainframe hardcoding the values. In UNIX the comp-3 position shifted by one position to the right. I could not figure out the cause. Please advice.