Previous Topic Next topic Print topic


Run-time Configuration Tunables - Overview

You normally configure your run-time system using a project's properties in the IDE. However, some run-time behavior cannot be configured using the IDE; this must be configured using run-time tunables, which are stored in a run-time configuration file.

When you build an executable within Visual Studio, the build process automatically copies the application configuration file into the output folder and renames it to <executable-base-name>.exe.mfgcf. The run-time system automatically applies the settings included in the file without the need to set the COBCONFIG.BLOCK environment variable. If COBCONFIG.BLOCK is already set, it takes precedence over the settings specified in the .exe.mfgcf file.

When your run-time system or linked executable starts up, it attempts to read the run-time configuration file. The run-time configuration file specifies values for the run-time tunables.

If a setting specified in the IDE conflicts with a setting in the configuration file, the setting specified in the IDE takes precedence.

The run-time configuration file is shared by all users of the run-time system.

For native COBOL, you create or edit a text-based run-time configuration file with a text editor, and then specify the location and name of the run-time configuration file using the COBCONFIG_ environment variable. The format of the text file is described in the sections Format of a Configuration File for Native COBOL and List of Run-time Tunables.

This is the order in which the run-time system processes the configuration settings:

When both are present, the configuration settings are accumulative, with the ones specified by COBCONFIG_ set first.

Examples

For example, if you want to use a configuration file called myconf.cfg , you set COBCONFIG_ as follows.

set COBCONFIG_=e:\mydir\myconf.cfg

For native COBOL, if you run the project from within the IDE, you can set COBCONFIG_ from the project's properties - click Environment on the Application tab in the project’s properties.

For .NET COBOL, you add a configuration file (such as an application.configuration file or web.configuration file) in Visual Studio. There is no need to use an environment variable to specify its location, because the file is part of the application managed at run-time.

The use of a configuration file is optional - no error is issued if it does not exist.

Previous Topic Next topic Print topic