For some of the ODBC APIs, you must set bit masks and must query bits. You can use the library routine iwzODBCTestBits to query bits. You must link the IWZODBC.LIB import library with any application that calls iwzODBCTestBits.
Call this routine as follows:
CALL “iwzODBCTestBits” USING identifier-1, identifier-2 RETURNING identifier-3
You can set multiple bits in a field with COBOL arithmetic expressions that use the bit masks defined in the ODBCCOB copybook. For example, you can set bits for SQL-CVT-CHAR, SQL-CVT-NUMERIC, and SQL-CVT-DECIMAL in the InfoValue field with this statement:
COMPUTE InfoValue = SQL-CVT-CHAR + SQL-CVT-NUMERIC + SQL-CVT-DECIMAL
After you set InfoValue, you can pass it to the iwzTestBits function as the second argument.
The operands in the arithmetic expression above represent disjoint bits as defined in the ODBCCOB copybook. As a result, addition sets the intended bits on. Be careful to not repeat bits in such an arithmetic expression, however, because the operation is not logical OR. For example, the following code results in InfoValue not having the intended SQL-CVT-CHAR bit on:
COMPUTE InfoValue = SQL-CVT-CHAR + SQL-CVT-NUMERIC + SQL-CVT-DECIMAL + SQL-CVT-CHAR
The call interface convention in effect at the time of the call must be CALLINT SYSTEM DESCRIPTOR.