You can configure your JCL environment to use the native database file handler, where catalog.dat and catalog files can be stored in a database.
This requires setting a number of environment variables within the JES region, and then configuring JES Mainframe System Support to use the datastore(s) you configured. Use the dbfhdeploy to move the catalog files from disk to the database.
You need to set the following environment variables in the enterprise server region:
Variable setting | Purpose |
---|---|
ES_DB_FH=Y | Enables the Micro Focus Database File Handler |
MFDBFH_CONFIG=<path-filename-config-file> | Locates the configuration file containing the list of data sources and their database types |
MFDBFH_SCRIPT_DIR=<path-to-scripts> | Locates the stored procedures required for Enterprise Server to interact with a database |
If you are configuring a JCL environment from scratch (that is, the catalog is currently empty), then the required catalog file and specified folder structure is created on completion of the first job that is run.
The example shown above creates a catalog.dat file, if one does not already exist, within the CAT folder in the PGJCLCAT datastore. The Default Allocated Dataset Location setting creates a sub-folder from the location of the catalog file for any cataloged data sets. These two options form the values of the MFSYSCAT and MFALLOC_LOC environment variables respectively.
If you are moving an existing catalog, the method of data set storage will determine which files you move to the database. If the data sets are stored relative to the catalog, you should move catalog.dat and all its data sets from disk to the same datastore. You can use the dbfhdeploy command line utility to upload the files and create the required folder structure to ensure that the relative file locations are maintained; that way, no changes to the catalog are necessary.
If an existing catalog contains absolute paths to its data sets, or the default data set allocation method (for example, when using ES_ALLOC_OVERRIDE) is different to or not relative to the catalog folder, you can either keep the data sets stored on disk, or you can move data sets to the database. If you do move a data set cataloged with an absolute path, you are required to re-catalog the entry, updating it with its new physical file location within the database.
For help on moving an existing disk-based catalog to a database, especially one that has a mixture of the storage methods mentioned above, refer to Moving a Catalog to a Database: the mfdbcatc utility can automate some of workload involved in relocating files that are already cataloged. [7]
You do not need to make any code changes to your batch application's source code to use files within a datastore.
If the enterprise server region running your JES environment terminates abnormally whilst any data files are open, Enterprise Server attempts to recover the files automatically. If you continue to receive errors accessing files (for example, file locked statuses), run the dbfhadmin command line utility to recover the files.