Product Documentation

FairCom RTG BTRV User Guide

Previous Topic

Next Topic

<redirinstance>

The <redirinstance> element is used when you need to specify instance-wide configuration options for files that should be handled by an external file system instead of the FairCom RTG file system. It accepts one attribute, lib, which specifies the library to be used as an external file system. (For COBOL, an additional attribute specifies the function in that library.)

This element is used if you need to use multiple file systems and you are using Btrieve or an older COBOL compiler that supports ExtFH for only a single external file system. For example, if you are already using an ExtFH for certain files, you can use the <redirinstance> element to redirect those files to that file system.

In V2 and later, FairCom RTG includes support for redirecting BTRV calls to other BTRV interfaces such as Pervasive Software / Actian Corporation Btrieve.

Attributes

Attribute

Description

Default value

lib

Specify the file name of the library (e.g., DLL) to be called. Use the complete path with no extension.

<redirinstance> can be configured without setting the lib attribute if the runtime supports fallback to the default file system. See "Fallback to the Default File System", below.

""

func

COBOL Only: Specify the name of the function to be called.

""

COBOL notes:

If you are using a compiler that natively supports multiple external files systems, such as Micro Focus 4 and later, use the functionality provided by the compiler to redirect.

When <redirinstance> is specified without <redirinstance func>, such as <redirinstance lib="mffh.dll">, an attempt is made to load function "MFFH" on Windows or "mFFH" on UNIX from the specified library.

For additional information, see Configuration Note for Micro Focus on 64-bit AIX and Dynamic Redirection.

Fallback to the Default File System

This modification introduces support to configure <redirinstance> so that the default file system is used to handle files. This functionality is available only for the ExtFH interface (because only Micro Focus COBOL supports the fallback to the default file system when the DYNREDIR= environment variable is in use).

The <redirinstance> can be configured without setting the <redirinstance lib> attribute if the runtime supports fallback to the default file system.

If the <redirinstance> is configured without the <redirinstance lib> attribute and the runtime does not support fallback to the default file system, a warning message "Invalid <redirinstance> configuration" is logged and the operation fails with an error.

Example 1

The following is a Windows Micro Focus configuration example to redirect files with .DAT extension to COBOL and handle all the other files through FairCom RTG:

<redirinstance lib="MFFH.DLL" func="MFFH" >

<file name="*.DAT"/>

</redirinstance>


<instance>

<file name="*"/>

</instance>

Example 2

This example demonstrates <redirinstance> to use the Micro Focus cobmffh.so.2 native file handler library under Unix/Linux:

<redirinstance lib="/opt/microfocus/lib/cobmffh.so.2" func="MFFH">

<file type="I" name="custmast" />

</redirinstance>

Your specific library requirement depends on your exact platform and COBOL distribution. Usually, these libraries are in the /lib folder under your COBOL distribution.

In This Section

Btrieve Examples

TOCIndex