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


{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.


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.


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 COBOL compiler directive is list().

cobol sample.pco anim preprocess(cobsql) cstart cstop csqlt=ora end-c comp5=yes endp;

The COBOL compiler directive specified is anim. The COBSQL directives, initiated by preprocess(cobsql) and terminated by end-c, are cstart cstop and csqlt=ora. The precompiler directive (in this case, Pro*COBOL), terminated by endp, is comp5=yes. The semicolon (;) indicates the end of the command line.