Configuring the IBM COBOL compiler on AIX

Before you develop IBM® COBOL applications that contain embedded SQL and Db2® API calls on AIX® operating systems, you must configure the IBM COBOL compiler.

About this task

Required steps if you develop applications that contain embedded SQL and Db2 API calls, and you are using the IBM COBOL for AIX compiler.

Procedure

  • When you precompile your application using the PRECOMPILE command, use the target ibmcob option.
  • Do not use tab characters in your source files.
  • You can use the PROCESS and CBL keywords in the first line of your source files to set compile options.
  • If your application contains only embedded SQL, but no Db2 API calls, you do not need to use the pgmname(mixed) compile option. If you use Db2 API calls, you must use the pgmname(mixed) compile option.
  • If you are using the "System z® host data type support" feature of the IBM COBOL for Linux on x86 compiler, the Db2 include files for your applications are in the following directory:
    $HOME/sqllib/include/cobol_i

    If you are building Db2 sample programs using the script files provided, the include file path specified in the script files must be changed to point to the cobol_i directory and not the cobol_a directory.

    If you are NOT using the "System z host data type support" feature of the IBM COBOL for AIX compiler, or you are using an earlier version of this compiler, then the Db2 include files for your applications are in the following directory:

    $HOME/sqllib/include/cobol_a

    Specify COPY file names to include the .cbl extension as follows:

    COPY "sql.cbl".