Import a Catalog: Example 2
In this example, a catalog, USERCAT4, that was previously exported, is imported. (See the EXPORT example, Export a Catalog: Example 1.) The original copy of USERCAT4 is replaced with the imported copy, from the portable file copy in CATBACK. Access method services finds and deletes the duplicate name, USERCAT4. Any aliases in the master catalog for USERCAT4 are preserved. (A duplicate name exists because the catalog was exported with the TEMPORARY attribute.) Access method services then redefines USERCAT4, using the catalog information from the portable file, CATBACK. USERCAT4 is locked to prevent access to anyone except authorized recovery personnel.
Requirement: Before you can lock a catalog, you must have read authority to the profile name, IGG.CATLOCK, with class type FACILITY.
//IMPRTCAT JOB ...
//STEP1 EXEC PGM=IDCAMS
//SOURCE DD DSNAME=CATBACK,UNIT=3390,
// VOL=SER=327409,DISP=OLD
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
IMPORT -
INFILE(SOURCE) -
OUTDATASET(USERCAT4) -
ALIAS -
LOCK -
CATALOG(ICFMAST1)
/*
- SOURCE DD describes the portable data set, CATBACK.
- INFILE points to the SOURCE DD statement.
- OUTDATASET gives the name of the catalog being imported. Access method services dynamically allocates the catalog.
- ALIAS specifies that aliases that already exist in the master catalog for USERCAT4 are to be preserved and that the aliases on the portable file are to be listed. However, if USERCAT4 had not existed in the system when importing, the aliases on the portable file would have been defined for USERCAT4.
- LOCK specifies that the catalog being imported is locked.
- CATALOG identifies the master catalog, ICFMAST1.