Cobol and Informix data storage problem
Posted in 1997
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I need some help in debugging a COBOL and INFORMIX data storage problem. I have a cobol program that accesses an Informix database which is returning a wrong value. Here are the details. 1. Cobol program stores data in a PIC S9(5) COMP field. MFCobol V3 defines the PIC S9(5) COMP field to be stored as 4 bytes. 2. Informix Online 7.22 has a field in the table where this is stored defined as Decimal(5 ) 3. Cobol writes a 0(zero) to the database. Upon reading the value from the database, it returns a 32. It seems like Informix is storing a PIC S9(5) in 3 bytes instead of 4. We tried truncating the last byte off the returned value and got a 0(zero). It also seems that the last byte is filled in with a space (hence, the 32 value since a space is and ASCII 20 and the hexadecimal conversion of that value is 32). Can anyone shed some light to what is going on here? Is there a COBOL directive that can solve this problem? Or is there a parameter in Informix Online or ESQL-Cobol that will solve this? Thanks. Mitch mitchg@worldtelphil.com