Informix Error -22283: Numeric value from database cannot be stored in COBOL data item.
Cause and resolution
Numeric value from database cannot be stored in COBOL data item.
In IBM Informix ESQL/COBOL, a number of conditions can cause this error message to appear. The value is too large, data cannot contain a negative value, a signed value cannot be stored in an unsigned data item, or a float overflow has occurred.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-22283 fires when a numeric value fetched from the database can't be stored in its target COBOL data item — per the official guidance, several conditions can cause this.
- The value being too large for the target item, per the official guidance — the first named case.
- The data containing a negative value the target item can't hold, per the official guidance — the second named case.
- A signed value being stored in an unsigned data item, per the official guidance — the third named case.
- A float overflow, per the official guidance — the fourth named case.
Solutions / Resolution
- Widen the target item's declared length, per the official guidance's implication, if the value is too large.
- Declare the target item signed if negative values are expected, per the official guidance.
- Check for float overflow and adjust the target item's type/size accordingly, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond one of the four named storage failures.
Diagnostic Checks
- Check the fetched value's sign, magnitude, and type against the target COBOL data item's declaration, and correct whichever of the four conditions applies.
Related Errors / Related Topics
- -22282 — "Invalid numeric data length." A related numeric-storage error, on the item's declaration itself being invalid (length/precision) rather than a specific value failing to fit at runtime.
A numeric database value couldn't be stored in its COBOL data item (too large, negative into unsigned, signed into unsigned, or float overflow) — correct the item's declaration.