Previous Topic Next topic Print topic


Specifying Directives

You specify directives to COBSQL as if they were Compiler directives, but you must put them after the directive PREPROCESS(cobsql).

It is also possible to add the COBSQL directives to the directives file cobol.dir.

Note:
  • Each line in the cobol.dir file may contain one or more compiler directives
  • Don't split a compiler directive across multiple lines in the cobol.dir file
  • When the compiler encounters either P(cobsql) or PREPROCESS(cobsql) in the cobol.dir file, the compiler passes the rest of the line to the pre-processor until it reaches an ENDP
  • The compiler treats the PREPROCESS directive and all the options that follow, up to the ENDP, as a single compiler directive. Therefore, the PREPROCESS directive and all the options must all appear on a single line in the cobol.dir file.

Alternatively, you can put COBSQL and precompiler directives in a file, cobsql.dir. This file should reside either in the current directory or in a directory specified by the environment variable COBDIR. COBSQL searches the current directory and then along the COBDIR path for a cobsql.dir file. Once COBSQL finds a cobsql.dir file, it stops searching. So, if you have a cobsql.dir file in the current directory, the COBDIR path is not searched.

Note:
  • Each line in the file cobsql.dir can contain one or more COBSQL directives
  • Since COBOL does not read the file cobsql.dir, don't put COBOL compiler directives into the file
  • Don't split a COBSQL directive across multiple lines in the file cobsql.dir
  • When COBSQL encounters either END-C, END or END-COBSQL in the cobsql.dir file, the rest of the line passes to the database precompiler
  • The options to be passed to the database precompiler must all appear on a single line in the file cobsql.dir

COBSQL processes cobsql.dir first and then any directives specified via the Build Settings screen or command line.

A number of the directives can be reversed by placing NO in front of them, for example, DISPLAY can be reversed using NODISPLAY. By default, the NO version of a directive is set.

You can specify shortened versions of some of the directives. If applicable, the shortened version of a directive is shown in the lists below, immediately after the full length version.

Some directives can be passed to COBSQL by the COBOL Compiler (see the section COBOL Directives below), removing the need to specify common directives more than once. Directives that can be retrieved from the COBOL Compiler are processed before COBSQL directives.

For example, in the following:

cobol testprog p(cobsql) csqlt=ora makesyn end-c 
      xref=yes mode=ansi endp list();
Previous Topic Next topic Print topic