In a CA Easytrieve Program, how do I correctly code the value assigned to a BINARY field when passing to a COBOL program?
search cancel

In a CA Easytrieve Program, how do I correctly code the value assigned to a BINARY field when passing to a COBOL program?

book

Article ID: 16199

calendar_today

Updated On:

Products

PanAudit Plus Easytrieve Report Generator PAN/SQL

Issue/Introduction



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?

Environment

Release: EDBMSU00200-11.6-Easytrieve-Report Generator-Option for DB2-MSU
Component:

Resolution

In the CA Easytrieve Program, you should declare it as type 'I'.

Please Note:
Type 'I' is an integer in new function mode.
In compatibility mode, a 4 byte binary value has type: 4 B
The 4 B type is valid in new function mode as well.