Running DB2 v8.2. I have a field defined as numeric (15,0). In my cobol program I define the field as S9(15)v comp-3. When I try to access this field using embedded SQL, the cursor fetch statement returns the following message -
--- error report ---
ERROR occurred : Fetch Cursor
SQLCODE : -00304
SQL0304N A value cannot be assigned to a host variable because the
value is not within the range of the host variable's data type.
SQLSTATE=22003
SQLSTATE 22003: A numeric value is out of range.
If I define the field as s9(7)v99 comp-3, the error goes away, but the data is incorrect, because it maps the field as 5 bytes, not 8.
How do I get round this.
The box is hp-ux, the compiler is acucobol and the pre-compiler is the ibm pre-compiler
--- error report ---
ERROR occurred : Fetch Cursor
SQLCODE : -00304
SQL0304N A value cannot be assigned to a host variable because the
value is not within the range of the host variable's data type.
SQLSTATE=22003
SQLSTATE 22003: A numeric value is out of range.
If I define the field as s9(7)v99 comp-3, the error goes away, but the data is incorrect, because it maps the field as 5 bytes, not 8.
How do I get round this.
The box is hp-ux, the compiler is acucobol and the pre-compiler is the ibm pre-compiler