In the CA Easytrieve program, the field passed to COBOL is defined as a type 'U', which is an unsigned packed decimal field. The value 20 is stored as x'00000020'. In the COBOL pgm, you declared it as PIC S9(8) COMP, which is a 4 byte integer. Integer value of x'00000020' is 32.
How can I get the correct value assigned to a BINARY field when passing to a COBOL program?