Skip to main content

Problem:

We are moving catalogued datasets from one location to another and need to be able to update the Mainframe Express Catalog with the new entries. We have many datasets and doing this manually is too time consuming. What can we do?

Resolution:

The following write-up describes our how mvspcrn can be used to update Mainframe

Express Catalog entries. Be aware that the parameters are case sensitive.  

  

Bulk Update of Catalog

If you move a number of datasets from one place on your PC or PC network to another - from one directory to another, from one network server to another, or from the control of one Fileshare server to another - you need to make sure each one's catalog entry shows the new path in the physical filename.

If the catalog and the datasets reside together on the same path, there is no problem. By default, paths in the catalog are stored as relative paths (although they are expanded before being displayed), so the relocation of the files is reflected automatically.

However, if the catalog resides in a different location to the data files, you must update the catalog entries. You can update them all in one command, using the utility mvspcrn.exe in a Net Express command prompt.

Before running the utility, you must set the environment variables:

MFSYSCAT - full path and filename of the catalog to be updated.

MFALLOC_LOC - full path of the Default Allocated Dataset Location.

In fact the value in MFALLOC_LOC is ignored, but it must be set. It's good practice to set it to the Default Allocated Dataset Location.

The format of the command line is:

mvspcrn old-string new-string

        

In each catalog entry where the physical filename (including path) starts with old-string, old-string is replaced by new-string.

The utility displays two prompts, asking you to confirm the setting of MFSYSCAT and the parameters, and then updates the catalog.

The parameters are case sensitive.

The utility does not actually move or rename any files. It only updates their catalog entries.

The utility affects entries for spool files as well as entries for cataloged datasets.

We strongly recommend that you back up your catalog before running this utility. Check that your MFSYSCAT points to the correct catalog.

old-string is compared to the string actually stored in the catalog, so, in the case of a file accessed via a Fileshare server, old-string should start with the Fileshare server name preceded by $$.

Examples

In all these examples, we'll assume your catalog is c:\\catalog\\catalog.dat.

Example 1

You have a set of datasets in directory c:\\datasets and you move them all to e:\\datasets. To update the catalog:

set mfsyscat=c:\\catalog\\catalog.dat

set mfalloc.loc=e:\\datasets

mvspcrn c e

Example 2

You have a set of datasets in directory c:\\datasets and you move them all to e:\\data. To update the catalog:

set mfsyscat=c:\\catalog\\catalog.dat

set mfalloc.loc=e:\\datasets

mvspcrn c:\\datasets e:\\data

Example 3

You have a set of datasets accessed via Fileshare server server1. They are in c:\\fsdir\\datasets, where c:\\fsdir is the Fileshare directory for server1. You do not move the datasets, but you stop the server and restart it with a different name, server2. To update the catalog:

set mfsyscat=c:\\catalog\\catalog.dat

set mfalloc.loc=$$server1\\datasets

mvspcrn $$server1 $$server2

Example 4

You have a set of datasets accessed via Fileshare server server1. They are in c:\\fsdir\\datasets, where c:\\fsdir is the Fileshare directory for server1. You move the datasets to c:\\fs2dir\\data, where c:\\fs2dir is the Fileshare directory for server2. In future you want to access them via server2. To update the catalog:

set mfsyscat=c:\\catalog\\catalog.dat

set mfalloc.loc=$$server1\\datasets

mvspcrn $$server1\\datasets $$server2\\data

Example 5

You have a set of datasets accessed via Fileshare server server1. They are in c:\\fsdir\\datasets, where c:\\fsdir is the Fileshare directory for server1. Those associated with your payroll application all have names beginning payroll, and you move these to c:\\fs2dir\\data, where c:\\fs2dir is the Fileshare directory for server2. In future you want to access these files via server2. To update the catalog:

set mfsyscat=c:\\catalog\\catalog.dat

set mfalloc.loc=$$server1\\datasets

mvspcrn $$server1\\datasets\\payroll $$server2\\data\\payroll

Old KB# 2542

#MFDS
#EnterpriseDeveloper