Quote:
|
Originally Posted by Marcus_A
PIC S9(4) COMP is a half word binary (2 bytes) and is the datatype used in COBOL for a DB2 smallint, so it does hold up to 32767. I think it is just a bug in DB2 and whomever wrote that part of DB2 made a mistake by rejecting that host variable.
|
Fully agree.
DB2 normally *only* accepts COBOL datatypes S9(4) COMP and S9(9) COMP for integer values (smallint & int); and an "S9(4) COMP" *can* hold the value 32767.
In all similar situations, DB2 (or rather: the precompiler) would reject an S9(5) COMP.
I would suggest you check which precompiler you are using; try switching to the COBOL built-in one if you currently use an external one, or vice versa.
If it's a bug (which I also think it is), it's most likely a precompiler bug.