Choose from the SQL Preprocessors supplied with
Visual COBOL to compile your applications.
- OpenESQL
- Before compiling from within
Visual COBOL:
- 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.
- If unchecked, check
Enable configuration specific settings and
Use SQL Preprocessor.
- From the
Preprocessor Type drop-down list, select
OpenESQL.
- Type the name of your database into the
Value field of the DB setting.
- To specify the type of database access you want, use the grid to set the value of the DBMAN directive to
ODBC or
JDBC.
- Click
Apply.
- 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:
- 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.
- Click in the
Additional directives value cell and type:
SQL(DBMAN=dbaType [SQLdirOpt])
Where
dbaType is
ODBC or
JDBC, and
SQLdirOpts is one or more additional directive options.
- DB2 ECM
-
- 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.
- Check
Enable configuration specific settings and
Use SQL Preprocessor.
- From the
Preprocessor Type drop-down list, select
DB2.
- 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.
- Click
Apply.
Alternatively, you can enter the preprocessor specification and options as additional directives:
- 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.
- 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.
- COBSQL
- Before compiling from within
Visual COBOL:
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:
- Expand
Micro Focus > Project Settings > COBOL > SQL Preprocessor.
- Check
Use SQL Preprocessor.
- From the
Preprocessor Type list, select
Oracle Pro*COBOL(COBSQL).
- Under
Setting choose a directive and specify its value under
Value.
- Repeat the previous step to add additional directives.
- Click
Apply, then click
OK.
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.