SQL プリプロセッサ

Enterprise Developer に付属している複数の SQL プリプロセッサから選択し、アプリケーションをコンパイルします。
OpenESQL
Enterprise Developer 内からコンパイルする前に、次を実行します。
  1. プロジェクト プロパティを開き、[Micro Focus > プロジェクト設定 > COBOL > SQL プリプロセッサ] の順に展開します
    注: [Micro Focus > ビルド構成 > COBOL > SQL プリプロセッサ] の下でコンパイラ指令オプションを設定することもできます。この方法では、設定はビルド構成がアクティブになっている場合のみ適用され、コンパイラ指令オプションが [プロジェクト設定] 内のまたはプログラム レベルの設定に設定されることはありません。
  2. [Enable configuration specific settings] と [Use SQL Preprocessor] チェック ボックスがオフの場合は、これらをオンにします。
  3. [プリプロセッサ タイプ] ドロップダウンの一覧から、[OpenESQL] を選択します。
  4. データベースの名前を DB 設定の "Value" フィールドに入力します。
  5. 任意のデータベース アクセスのタイプを指定するには、グリッドを使用して DBMAN 指令の値を ODBC または JDBC に設定します。
  6. [Apply] をクリックします。
  7. グリッドを使用して追加する指令オプションを選択し、値を設定します。設定ごとに [Apply] をクリックします。

または、プリプロセッサの仕様とオプションを追加の指令として入力できます。

  1. プロジェクトのプロパティを開き、[Micro Focus > Project Settings > COBOL] の順に展開します。
    注: または [Micro Focus > ビルド構成 > COBOL] の順に選択してもプリプロセッサを設定できます。この方法では、設定はビルド構成がアクティブになっている場合のみ適用され、[プロジェクト設定] 内またはプログラム レベルでプリプロセッサが他のプリプロセッサに設定されることはありません。
  2. "追加指令" フィールドをクリックして、次を入力します。
    SQL(DBMAN=dbaType [SQLdirOpt])

    dbaTypeODBC または JDBC で、SQLdirOpts は 1 つまたは複数の追加指令オプションです。

DB2 ECM
  1. Open your project properties and expand Micro Focus > Project Settings > COBOL > SQL Preprocessor.
    注: You can also set the preprocessor under Micro Focus > Build Configurations > COBOL > SQL Preprocessor. If you do this, the setting applies only when the build configuration is active, and the preprocessor is not set to something else in the Project Settings or on the program level.
  2. Check Enable configuration specific settings and Use SQL Preprocessor.
  3. From the Preprocessor Type drop-down list, select HCO for DB2 LUW.
  4. Type the name of your database into the Value field of the DB setting.
    注: If you leave the value for DB blank, the compiler uses the database specified by the value of the DB2DBDFT environment variable.
  5. Click Apply.

Alternatively, you can enter the preprocessor specification and options as additional directives:

  1. Open your project properties and expand Micro Focus > Project Settings > COBOL.
    注: You can also set the preprocessor under Micro Focus > Build Configurations > COBOL. If you do this, the setting applies only when the build configuration is active, and the preprocessor is not set to something else in the Project Settings or on the program level.
  2. Click in the Additional directives field and type:
    DB2[(DB=dbName [DB2dirOpts])]

    Where dbName is the name of your DB2 database, and DB2dirOpts is one or more additional directive options.

    注: If you do not specify the DB option, the compiler uses the database specified as the value of the DB2DBDFT environment variable.
COBSQL
Before compiling from within Enterprise Developer:
注: You can also set the preprocessor under Micro Focus > Build Configurations > COBOL > SQL Preprocessor. If you do this, the setting applies only when the build configuration is active, and the preprocessor is not set to something else in the project settings or at the program level.

For Oracle Pro*COBOL, you can set the COBSQL preprocessor and compiler directives from the project's properties:

  1. Expand Micro Focus > Project Settings > COBOL > SQL Preprocessor.
  2. Check Use SQL Preprocessor.
  3. From the Preprocessor Type list, select Oracle Pro*COBOL(COBSQL).
  4. Under Setting choose a directive and specify its value under Value.
  5. Repeat the previous step to add additional directives.
  6. Click Apply, then click OK.
注: Ensure that no conflicting preprocessor directives are set in Additional Directives.
注: Adding the Oracle Pro*COBOL (COBSQL) preprocessor to the SQL Preprocessor file, build configuration or project property page automatically adds a read-only entry to the top of the preprocessors list in the Additional Preprocessors property page. If you have multiple preprocessors in the preprocessors list, you can change the sequence of execution by moving preprocessors up and down the list. See section Additional Preprocessors for more information.