SQL preprocessors

Choose from the SQL preprocessors supplied with Enterprise Developer to compile your applications.
OpenESQL
Before compiling from within Enterprise Developer:
  1. Open your project properties and expand Micro Focus > Project Settings > COBOL > SQL Preprocessor.
    Note: You can also set compiler directive options under Micro Focus > Build Configurations > COBOL > SQL Preprocessor. If you do this, the setting applies only when the build configuration is active, and the compiler directive option is not set to something else in the Project Settings or on the program level.
  2. If unchecked, check Enable configuration specific settings and Use SQL Preprocessor.
  3. From the Preprocessor Type drop-down list, select OpenESQL.
  4. Type the name of your database into the Value field of the DB setting.
  5. To specify the type of database access you want, use the grid to set the value of the DBMAN directive to ODBC or JDBC.
  6. Click Apply.
  7. Use the grid to select additional directive options and set appropriate values. Click Apply after each setting.

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

  1. Open your project properties and expand Micro Focus > Project Settings > COBOL.
    Note: 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. In the Additional directives value cell, click and in the Additional directives dialog box, type:
    SQL(DBMAN=dbaType [SQLdirOpt])

    Where dbaType is ODBC or JDBC, and SQLdirOpts is one or more additional directive options.

DB2 ECM
  1. Open your project properties and expand Micro Focus > Project Settings > COBOL > SQL Preprocessor.
    Note: 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.
    Note: 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.
    Note: 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. In the Additional directives value cell, click and in the Additional directives dialog box, type:
    DB2[(DB=dbName [DB2dirOpts])]

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

    Note: If you do not specify the DB option, the compiler uses the database specified as the value of the DB2DBDFT environment variable.
XDB (Windows)
  1. Open your project properties and expand Micro Focus > Project Settings > COBOL > SQL Preprocessor.
    Note: 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 EXEC SQL.
  3. From the Preprocessor Type drop-down list, select XDB.
  4. Configure the database in the Client Options console (Click Start > All Programs > Micro Focus Enterprise Developer > Data Tools > SQL Option for DB2 > Configuration > Client Options).
COBSQL
Before compiling from within Enterprise Developer:
Note: 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 and Close.
Note: Ensure that no conflicting preprocessor directives are set in Additional Directives.
Note: 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.