Previous Topic Next topic Print topic


Application Configuration File

You can specify how your native COBOL application should be run, by specifying the required settings in an application configuration file.
Restriction: The following applies to native code only.

The application configuration file has a .config extension, and you can specify the following in it:

You can add an application configuration file to your project as follows:

  1. In Solution Explorer, right-click your project.
  2. Click Add > New Item.
  3. Select Application Configuration File.
  4. Specify a filename in the Name field.
  5. Click OK.

To set run-time configuration settings in the application configuration file:

  1. In Solution Explorer, right-click the application configuration file in the project, and click Open.

    By default, an application configuration file has a .config extension. If the file does not exist, add one for the project - see Related information.

  2. On the Environment tab, type a variable name and its value in the Name and Value fields, and click Set.
  3. On the COBOL Switches tab, check the switches you require.
  4. On the Run-time Configuration tab, configure settings such as the search order for called programs, command line handling and file handling options, and input/output settings.
  5. Click OK.

If you run your application outside of the IDE, you need to set the environment variable COBCONFIG.BLOCK to the location of the application configuration file in order for the switches and environment variables set for the application to be applied.

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.

Previous Topic Next topic Print topic