Setting Compiler Directives for COBOL

You can use directives to control the way the Compiler behaves: what output it produces, what code is compiled and how the compiled code behaves when it runs. For normal operation you need only a few directives. Most of the time, you use the default values.

Important: Setting some directives affects the default setting of other directives. For example, setting one directive might automatically unset another directive, and some directive settings are mutually exclusive.

You can set Compiler directives at four levels within the IDE from the project's properties:

  • Micro Focus > Project Settings - These settings apply to all programs in a single project.
  • Micro Focus > Build Configurations - These settings apply to a specific build configuration. Each project is associated with one or more build configurations, and directives set here override or add to those set in Project Settings.
  • Right-click the folder, and then click COBOL > SQL Preprocessor and COBOL > Additional Preprocessors - These settings apply to all programs within that folder.
  • Right-click the program, and then click COBOL > SQL Preprocessor and COBOL > Additional Preprocessors - the settings you specify at the COBOL page of the file properties override or add to both the project settings and the build configuration settings. You can only specify an SQL preprocessor at file level, if no preprocessor is enabled for the project or for the build configuration.
    Important: You invoke the COBOL and COBOL > SQL Preprocessor pages for an individual file by right-clicking the file and selecting Properties. Do not confuse this with the COBOL and COBOL > SQL Preprocessor pages available under Project Settings and Build Configurations.

The directives set in the properties are written to a .mfdirset file. See Setting Compiler Directives in an .mfdirset File for more information.

In addition, you can set Compiler directives in a number of other ways, such as on the command line, or in a directives file, or as part of a response to a prompt.

Separate Compiler directives with a space. You can supply parameters either within brackets or quotation marks: for example charset"ascii" dialect(MF), and if you need more than one parameter for a particular directive, separate the parameters with a space: for example outdd(sysout 121 r e) or ACTUAL-PARAMS"MyInterface ClassA ClassB".

Important: For applications that use an RDBMS, you might need to set some additional directives in your build configuration.