DB2 Version 10.1 for Linux, UNIX, and Windows

AIX Micro Focus COBOL application compile and link options

The compile and link options for building COBOL embedded SQL and DB2® API application with the Micro Focus COBOL for AIX® compiler are available in the bldapp build script. Note that the DB2 Micro Focus COBOL include files are found by setting up the COBCPY environment variable, so no -I flag is required in the compile step. Refer to the bldapp script for an example.

Compile and link options for bldapp

Compile options:
cob
The MicroFocus COBOL compiler.
-c
Perform compile only; no link.
$EXTRA_COBOL_FLAG="-C MFSYNC"
Enables 64-bit support.
-x
When used with -c, produces an object file.
Link Options:
cob
Use the compiler as a front end for the linker.
-x
Produces an executable program.
-o $1
Specify the executable program.
$1.o
Specify the program object file.
-L$DB2PATH/$LIB
Specify the location of the DB2 runtime shared libraries. For example: $HOME/sqllib/lib32.
-ldb2
Link to the DB2 library.
-ldb2gmf
Link to the DB2 exception-handler library for Micro Focus COBOL.

Refer to your compiler documentation for additional compiler options.