Problem:
How can I define decimal numbers with ODBCLink/SE and InstantSQL?
Resolution:
In order to get numbers with fractional parts (i.e. decimals) the SQL data type must be SQL_DECIMAL. The Image data types that convert to SQL_DECIMAL are:
DECIMAL (Internal representation is packed decimal)
Image Zoned (Z)
Image Packed (P)
Image I3 (48-bit integer)
Image I4 (64-bit integer)
It is certainly possible to have a BINARY (i.e. 32-bit integer physical storage) data item use a picture such as PIC 9(6)v99 -- at least this is possible in RM/COBOL, and is required by the COBOL standard. So this might be the case where the implementation is overloading an underlying integer data type with a decimal scale factor (the V99 part of the PIC) that is not known to the Image database per se.
It would be interesting to find some capability of configuring the ODBC driver so that it will return SQL_DECIMAL for those Image fields that are described in COBOL with a scale factor.
Otherwise, it appears that the only mechanism available would be to change the underlying Image data type to one of those listed above, so that SQL_DECIMAL may be returned. It is not clear how the decimal scale factor is stored in the Image database schema.