Operation

To use COBSQL, specify the PREPROCESS(cobsql) Compiler directive when you compile your program. All directives following it are passed from the Compiler to COBSQL. You can specify Compiler directives by using $SET statements in your program or via the Additional Directives field, located on the COBOL tab of your project's Properties dialog box..

To terminate the directives to be passed to COBSQL, you must use the ENDP COBOL directive. You can do this by adding the following line either to the project settings or to the end of the Net Express build settings:

preprocess(cobsql) csqltype=database_product end-c 
    comp5=yes endp;

where database_product is one of Oracle, Sybase or Informix. For example, for Oracle:

preprocess(cobsql) csqltype=oracle end-c comp5=yes endp;
Note: Visual COBOL 2010 ignores any directives placed after the semi-colon (;) in the Additional Directives field. Therefore, if you add the above line to the additional directives, you must position the line at the end of the settings.

Since the system sets extra default COBOL directives, the above line is required when putting directives into the Additional Directives field.

END-C and ENDP have the following effect:


Examples:

cobol testprog p(cobsql) cobsqldirectives END-C precompileroptions ENDP compilerdirectives;
cobol testprog p(cobsql) csqlt=ora makesyn end-c xref=yes mode=ansi endp list();

·         

The COBSQL directives, terminated by end-c, are csqlt=ora and makesyn · The precompiler directives (in this case, Pro*COBOL), terminated by endp, are xref=yes and mode=ansi · The Compiler directive is list().

Related information
COBSQL Directives