11.01.2013 Views

ABCs of z/OS System Programming Volume 3 - IBM Redbooks

ABCs of z/OS System Programming Volume 3 - IBM Redbooks

ABCs of z/OS System Programming Volume 3 - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3. Use EXAMINE and DIAGN<strong>OS</strong>E to ensure that the catalogs are error-free. Fix any errors<br />

indicated (see also “Checking the integrity on an ICF structure” on page 357).<br />

4. Use REPRO MERGECAT without specifying the ENTRIES or LEVEL parameter. The<br />

OUTDATASET parameter specifies the catalog that you are keeping after the two catalogs<br />

are merged. Here is an example:<br />

//MERGE6 JOB ...<br />

//STEP1 EXEC PGM=IDCAMS<br />

//DD1 DD VOL=SER=VSER01,UNIT=DISK,DISP=OLD<br />

// DD VOL=SER=VSER02,UNIT=DISK,DISP=OLD<br />

// DD VOL=SER=VSER03,UNIT=DISK,DISP=OLD<br />

//SYSPRINT DD SYSOUT=A<br />

//SYSIN DD *<br />

REPRO -<br />

INDATASET(USERCAT4) -<br />

OUTDATASET(USERCAT5) -<br />

MERGECAT -<br />

FILE(DD1)<br />

FROMKEY(WELCHA.C.*) TOKEY(WELCHA.E.*)<br />

/*<br />

Important: This step can take a long time to complete. If the MERGECAT job is cancelled,<br />

then all merged entries so far remain in the target catalog. They are not backed out in<br />

case the job fails. See “Recovering from a REPRO MERGECAT Failure” in z/<strong>OS</strong><br />

DFSMS: Managing Catalogs, SC26-7409, for more information about this topic.<br />

Since z/<strong>OS</strong> V1R7, REPRO MERGECAT provides the capability to copy a range <strong>of</strong> records from<br />

one user catalog to another. It allows recovery <strong>of</strong> a broken catalog by enabling you to copy<br />

from one specific key to another specific key just before where the break occurred and<br />

then recover data beginning after the break. Refer to the parameters FROMKEY/TOKEY in the<br />

previous example.<br />

5. Use the listing created in step 2 to create a sequence <strong>of</strong> DELETE ALIAS and DEFINE ALIAS<br />

commands to delete the aliases <strong>of</strong> the obsolete catalog, and to redefine the aliases as<br />

aliases <strong>of</strong> the catalog you are keeping.<br />

The DELETE ALIAS/DEFINE ALIAS sequence must be run on each system that shares the<br />

changed catalogs and uses a separate master catalog.<br />

6. Use DELETE USERCATALOG to delete the obsolete catalog. Specify RECOVERY on the<br />

DELETE command.<br />

7. If your catalog is shared, run the EXPORT DISCONNECT command on each shared system to<br />

remove unwanted user catalog connector entries. If your catalog is shared, run the EXPORT<br />

DISCONNECT command on each shared system to remove unwanted user catalog<br />

connector entries.<br />

8. Use ALTER UNLOCK to unlock the remaining catalog.<br />

You can also merge entries from one tape volume catalog to another using REPRO MERGECAT.<br />

REPRO retrieves tape library or tape volume entries and redefines them in a target tape volume<br />

catalog. In this case, VOLUMEENTRIES needs to be used to correctly filter the appropriate<br />

entries. The LEVEL parameter is not allowed when merging tape volume catalogs.<br />

362 <strong>ABCs</strong> <strong>of</strong> z/<strong>OS</strong> <strong>System</strong> <strong>Programming</strong> <strong>Volume</strong> 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!