Enabling Dynamic Redirection to a Custom File Handler

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

Variable Value
DYNREDIR       DYNCONFIG:EXPAND
FHREDIR <fhredir_config>

fhredir_config contains the redirection information, for example:

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

where <VSAM_dir>\* means that any COBOL file that has an XFD in the directory specified by VSAM_dir is redirected to the database.

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

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

DYNREDIR=DYNCONFIG:EXPAND causes all filenames to be fully expanded into their pathnames. For example, if you have an entry:

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

and a COBOL file called DBFILE, it expands to:

<VSAM_dir>\DBFILE

If 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 VFILE and your XFD file is DBFILE.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 tries to redirect any file in that directory to the database. because VFILE is a VSAM file, you have to either specify the full path for the XFD as follows:

/f <VSAM_dir>\DBFILE    /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, modify your COBOL program ASSIGN statement to specify the XFD_dir, for example:

ASSIGN TO DISK "<XFD_dir>\DBFILE"

In addition, 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>

Search for file handler redirection in the online help for more information.