Importing and Exporting a Catalog: import export utility

The catalog import-export utility is supplied to make it easier to work with the contents of a catalog. You can use the catalog import export utility to:

Note:

This utility is intended as a tool for use during migrations. It is definitely NOT recommended that you use it for editing the catalog data for live systems. The recommended way of manipulating catalog entries is via JCL, where consistency can be guaranteed. For bulk changes to the PC-DSN field, MVSPCRN is recommended.

Use caution when performing catalog updates. Setting inconsistent field values will cause errors.

Setting the MFSYSCAT environment variable

In order to use the catalog import export utility, you need to set the MFSYSCAT environment variable to the catalog path and filename. For example:
set MFSYSCAT=c:\test\project\catalog.dat

Controlling the case of the PCDSN field

When run in a Windows environment, the PCDSN field (that is, the physical file location and name) is folded into upper case when catalog records are inserted or updated, unless the following environment variable is set:
MFJ_STRICT_CASE=Y

Invoking the catalog import export utility from the command line

The utility can be invoked from the command line or by calling it from another program. Use the syntax:
Call MVSP0033 using ws-command-line
In the command above, ws-command-line is a command with the syntax and parameters described below.

Syntax

For Windows:

mfcatxml FUNC(xxxx) INFILE(filename) 
OUTFILE(filename) KEY(xxxx)

For UNIX:

mfcatxml FUNC\(xxxx\) INFILE\(filename\) 
OUTFILE\(filename\) KEY(xxxx)
Note: You must escape the parentheses.

The function's operation, and the parameters that you use, varies depending on the value of the FUNC parameter.

On completion, mfcatxml displays a message which indicates either success or a failure. The return codes are as follows:
0
The utility has completed successfully.
12
The utility encountered an error.
Note: When exporting a large catalog, you can limit the number of records in each xml document by setting the environment variable MF_MVSP0034_LIMIT. For example, MF_MVSP0034_LIMIT=10000 will limit the number of catalog records in each document to 10000.

When this value has been reached, a new catalog xml document is created. The name of the file is constructed from the output file name plus an incremental suffix number from 001 to 999. For example:

mfcatxml func(exp) outfile(cat_export.xml) 

Produces the following files: cat_export.xml, cat_export001.xml, cat_export002.xml, etc.

Export entire catalog: Func = EXP

Exports the entire catalog to an XML file.

OUTFILE The name of the file to hold the exported data.
RELATIVE_PATH(Y) If the physical location of the cataloged data file is under the folder that contains the system catalog, then using RELATIVE_PATH(Y) causes the full path value in the R-PC-DSN element of the catalog record to be replaced by <CatalogFolder>.

For example:

<R-PC-DSN><CatalogFolder>\DATA\S2.SSSS.DAT</R-PC-DSN>

SUPPRESS_DT(Y) Sets the value of create date, create time, change date, change time, compile date and compile time to zero.

Import a catalog: Func = IMP

Imports a catalog from an XML file.

INFILE The name of the file with the catalog data to be imported.

Export specific catalog records: Func = GU

Reads details for specified catalog records and writes them to a file.

INFILE(filename) The catalog entries for all the MVS DATASET names found in the XML document filename are retrieved
KEY(datasetname) The record for the single MVS dataset name in the datasetname parameter is retrieved
KEY(@filename) The records for all the MVS dataset name in the filename parameter are retrieved. filename must be a text file with each successive dataset on a new line.
OUTFILE(filename) The output file for the catalog records.
Note:
  • One of INFILE(filename), KEY(datasetname) or KEY(@filename) is required. They are mutually exclusive alternatives to specifying the dataset name(s) to be retrieved.
  • OUTFILE(filename) is mandatory.

Insert records into a catalog: Func = ISRT

Reads catalog record details from INFILE and inserts these catalog records.

INFILE(filename) The name of the XML file with the catalog data to be inserted.

Replace existing catalog records: Func = REPL

Reads catalog record details from INFILE and replaces corresponding existing catalog records.

INFILE(filename) The name of the XML file with the catalog data to be replaced.

Delete catalog records: Func = DLET

Deletes catalog records.

INFILE(filename) Deletes catalog entries for all the MVS DATASET names found in filename.
KEY (datasetname) Deletes the record for the single dataset name set defined in datasetname.
KEY(@filename) Deletes all of the catalog records for all the MVS dataset names listed in filename. This file must be a text file with each successive dataset on a new line.
Note: One of INFILE(filename), KEY (datasetname) or KEY(@filename) is required. They are mutually exclusive alternatives to specifying the dataset name(s) to be deleted.

Examples

The following command creates the OUT.XML XML file that contains all of the data held in the catalog identified in the MFSYSCAT environment variable.

mfcatxml FUNC(EXP) OUTFILE(OUT.XML) 

The resulting XML file can be edited and then imported using the following command:

mfcatxml FUNC(IMP) INFILE(OUT.XML)