Describes the use of the PREPROCESS compiler directive with the (cobsql) option, used to compile COBSQL programs and applications.


cob -C "{preprocess | p}(cobsql) [[[{cobsqltype|csqlt}==preCompiler] [COBSQLopts] {end-cobsql|end-c|end}] [PreCompilerOpts endp]]"


The name of a third-party database precompiler. Default is oracle8. See COBSQLTYPE, CSQL for a full list of valid values.
COBSQL compiler directive options. See COBSQL Compiler Directive Options for complete information on each option.
Signals the end of COBSQL options.
Third-party precompiler directive options.
Signals the end of options specified for the PREPROCESS directive.


cobsql must be in lower case.

end-c and endp have the following effect:

  • Directives placed before end-c pass to COBSQL.
  • Directives placed between end-c and endp pass via COBSQL to the third-party precompiler.
  • Directives placed after endp pass to the COBOL compiler.
    Warning: Be careful not to omit the endp before adding COBOL compiler directives. COBSQL continues to process directives until it reaches endp; therefore, if you omit it, your COBOL directives are processed by COBSQL instead of the COBOL compiler.


cob –k testprog.pco –C "p(cobsql) csqlt==ora makesyn end-c xref==yes mode==ansi endp ans85"

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 COBOL compiler directive is ans85.

cob -k sample.pco anim "preprocess(cobsql) csqlt==ora end-c comp5==yes endp"

The COBOL compiler directive specified is anim. The COBSQL directive, initiated by preprocess(cobsql) and terminated by end-c, is csqlt==ora. The precompiler directive (in this case, Pro*COBOL), terminated by endp, is comp5==yes.