Configuring the IBM COBOL compiler on Windows

When you develop an embedded SQL application with the IBM® VisualAge® COBOL compiler on Windows operating system, following db2 prep option and compiler options must be set.

Procedure

  • When you precompile your application with the Db2® precompiler, and use the command line processor command db2 prep, use the target ibmcob option.
  • Do not use tab characters in your source files.
  • Use the PROCESS and CBL keywords in your source files to set compile options. Place the keywords in columns 8 to 72 only.
  • 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/390® host data type support" feature of the IBM VisualAge COBOL compiler, the Db2 include files for your applications are in the following directory:
    %DB2PATH%\include\cobol_i

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

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

    %DB2PATH%\include\cobol_a

    The cobol_a directory is the default.

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