BINARY/COMP-4 data types in COBOL embedded SQL applications

The Db2® COBOL precompiler supports the use of BINARY, COMP, and COMP-4 data types wherever integer host variables and indicators are permitted. If you use these data types, you must ensure that the target COBOL compiler views, or can be made to view, the BINARY, COMP, or COMP-4 data types as equivalent to the COMP-5 data type.
In the examples provided, such host variables and indicators are shown with the type COMP-5. Target compilers supported by Db2 that treat COMP, COMP-4, BINARY COMP and COMP-5 as equivalent are:
  • IBM® COBOL Set for AIX®
  • Micro Focus COBOL for AIX