You can specify the COBSQL preprocessor and its directives using any of the following methods:
- In your
Enterprise Developer Project Properties
- Before compiling from within
Enterprise Developer:
- 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 field, type
PREPROCESS(cobsql) followed by applicable COBSQL directive options. See
PREPROCESS(cobsql) and
COBSQL Compiler Directives for details.
- On the Command Line
- Use this method when compiling from an
Enterprise Developer command prompt. See
PREPROCESS(cobsql) and
COBSQL Compiler Directives for details.
- In a Directives File
- You can include COBSQL directives in the
cobsql.dir file, the
cobol.dir system-wide directives file, or a user directives file. For COBSQL applications, we recommend that you place your directives in only one of these files:
- cobsql.dir file
- To ensure that COBSQL retrieves its compiler directives from a
cobsql.dir file, you must specify the COBSQL preprocessor (without additional directives) either in your project properties or on the command line. This instructs COBSQL to look for
cobsql.dir as its first task. The
cobsql.dir file must reside in either the current directory or in a directory specified by the COBDIR environment variable. COBSQL searches the current directory and then along the COBDIR path for
cobsql.dir. COBSQL uses the first found instance of
cobsql.dir. Using any text editor, follow these rules when creating the content of a
cobsql.dir file:
- Do not include COBOL compiler directives in
cobsql.dir. COBOL does not read the
cobsql.dir file.
- Put one or more COBSQL directives on each line in the file.
- Do not split a COBSQL directive across multiple lines.
- When COBSQL encounters either END-C, END, or END-COBSQL, 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
cobsql.dir file.
- cobol.dir file and User Directives file
-
- When the compiler encounters the PREPROCESS directive, it passes the rest of the line to COBSQL until it reaches 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 its options must all appear on a single line.
See
System-wide Directives File, cobol.dir,
PREPROCESS(cobsql),
COBSQL Compiler Directives, and
User Directives File for details.
- Embedded in a Program
- You can also specify the COBSQL preprocessor and its directives on the program level by embedding a $SET statement into the program itself:
- Because COBSQL only supports a fixed source format (SOURCEFORMAT"FIXED", which is the default setting), place the $SET statement in column 7 on the first line of the program.
- Follow the $SET statement with the appropriate PREPROCESS(cobsql) command-line syntax.
Important: Use this method only when the program requires a preprocessor different from other programs in an application.
See
PREPROCESS(cobsql) and
COBSQL Compiler Directives for details.