Previous Topic Next topic Print topic


Enabling Dynamic Redirection to a Custom File Handler

To enable the dynamic redirection of the file handler, set the following environment variables:

Variable Value
DYNREDIR     DYNCONFIG:EXPAND
FHREDIR <fhredir_config>

If you are using Enterprise Server, you also need to set the following environment variable:

Variable Value
TXFILEP     <VSAM_dir>

If you are using Enterprise Server with only a database, TXFILEP needs to point to the directory where Micro Focus VSAM files would normally be found, and the XFD files need to go into the same directory specified by TXFILEP.

fhredir_config contains the redirection information, for example:

/f$TXFILEP\*     /r ACUFH!ACUFH
/f<VSAM_dir>\*   /r ACUFH!ACUFH

where $TXFILEP\* is needed only if you are using Enterprise Server, and <VSAM_dir>\* means that any COBOL file that has an XFD in the directory specified by VSAM_dir is redirected to the database.

If you are not using Enterprise Server, $TXFILEP is not needed.

You can replace the <VSAM_dir>\* with the full path, including the filename, for example:

/f<VSAM_dir>\ACCTFIL /r ACUFH!ACUFH

The DYNREDIR=DYNCONFIG:EXPAND fully expands all filenames into their pathnames. For example, if you have an entry:

/f<VSAM_dir>\*   /r ACUFH!ACUFH

and a COBOL file called ACCTFIL, it expands to:

<VSAM_dir>\ACCTFIL

If you are not using Enterprise Server, and you are using VSAM and database files in the same COBOL program, you cannot have the VSAM files in the same directory as the XFD files if you are using wildcards like <VSAM_dir>\*. This is because the wildcard tells the run time to redirect all COBOL files in the specified directory to the database. For example, if your VSAM file is ACCTFIL and your XFD file is DBACCTFIL.xfd and they are in a directory specified by <VSAM_dir>, you cannot use:

/f <VSAM_dir>\*   /r ACUFH!ACUFH

This is because the DYNREDIR logic redirects any file in that directory to the database, but you don't want to do this for ACCTFIL because it is a VSAM file. You have to either specify the full path for the XFD like this:

/f <VSAM_dir>\DBACCTFIL    /r ACUFH!ACUFH

or put the XFD in a different directory and specify the directory with the wildcard, for example:

/f <XFD_dir>\*   /r ACUFH!ACUFH

where XFD_dir is a directory where your XFD files reside and is different from the directory where your VSAM files reside. If you have a separate directory for your XFDs like this, you need to modify your COBOL program ASSIGN statement to specify the XFD_dir, for example:

ASSIGN TO DISK "<XFD_dir>\DBACCTFIL"

In addition, you need to modify your ACUFH configuration file and set XFD_DIRECTORY to XFD_dir so that the file handler can find your XFD files, for example:

XFD_DIRECTORY <XFD_dir>
Previous Topic Next topic Print topic