Renaming IAM Data Sets


Renaming IAM Data Sets

IAM data sets can be easily renamed by using the IDCAMS ALTER command, the TSO ALTER command, or from the IAM ISPF panels. For Non-SMS managed data sets, the new data set name remains cataloged in the same catalog as the original data set name, even if the new high level index is an alias to a different catalog. The NONVSAM version of the ALTER command must be used for IAM data sets.

Alternate Index Concerns

IAM data sets that have Alternate Indexes, are paths that have special considerations, due to the internally stored association information that is based on the data set name. The association information is not automatically updated when a rename is performed. Having the correct association information is necessary to prevent failures during OPEN processing, and DELETE processing. To update the association information, it will be necessary to perform an IDCAMS DEFINE RECATALOG on one or more of the associated data sets. IAM has special processing for DEFINE RECATALOG requests to update any data set associations. The association information can be verified by performing an IDCAMS LISTCAT ALL on the associated data sets. If you are performing renames on more than one of the associated data sets, the DEFINE RECATALOG should be executed after all of the renaming is completed.

The following rules for recataloging must be followed. First, if renaming multiple associated data sets, wait until all the renames are done before performing the recatalog. Then, the recatalog can be performed as indicated based on the types of data sets that were renamed. After renaming a base cluster, all of the associated alternate indexes and paths must be recataloged. After renaming an alternate index, the alternate index and any associated paths must be recataloged. After renaming a path, only the path has to be recataloged. The recatalog must first be performed on the alternate index data sets, and then on the path data sets. Additional information on IDCAMS RECATALOG is in 10.84 Recataloging IAM Datasets.

The IAM ISPF panels have a RENAME function, which will perform the necessary DEFINE RECATALOGS automatically, if consent is given to do so.

Example A:Rename with IDCAMS ALTER

The first example demonstrates the use of IDCAMS ALTER to rename an IAM data set. The high level qualifier is unchanged, so the data set will remain in the same catalog, unless you are using multilevel alias support.

Using IDCAMS ALTER to Rename an IAM Data set (EX1083A)

//RENAME   EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//IAMPRINT DD   SYSOUT=*
//SYSIN    DD   *
LISTCAT ENT(myiam.origname.dataset) ALL
ALTER   myiam.origname.dataset      -
NEWNAME(myiam.newname.dataset)
LISTCAT ENT(myiam.newname.dataset)  ALL
/*

Example B: Rename into Different Catalog

In the next example, an IDCAMS ALTER is again used to change the data set name. However, in this case the data set is a non-SMS managed data set, and the new high level index is an alias in a different catalog than the original high level index. This problem is resolved by performing a DEFINE RECATALOG with the new data set name, followed by deleting the new entry from the old catalog.

Rename into a different catalog (EX1083B)

//RENAME   EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//IAMPRINT DD   SYSOUT=*
//SYSIN    DD   *
 LISTCAT ENT(myiam.origname.dataset) ALL
 ALTER myiam.origname.dataset -
    NEWNAME(test.newname.dataset)
 DEFINE CLUSTER(NAME(test.newname.dataset) -
    OWNER($IAM) -
    VOL(volser) -
    RECATALOG)  -
    CATALOG(test.catname)
 DELETE test.newname.dataset NOSCRATCH NONVSAM-
    CATALOG(myiam.catname)
 LISTCAT ENT(test.newname.dataset) ALL
/*

Example C: Renaming an Alternate Index

In this example, a base cluster, the associated alternate index, and the associated path are all renamed using the IDCAMS ALTER command. Subsequent to the rename, DEFINE REATALOG is issued on the Alternate Index and the path to update the association information with the new names. A volume of ANYVOL can be specified for convenience when the actual volume serial numbers are not known.

Example of Rename an Alternate Index (EX1083C)

//RENAME EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
ALTER example.myiam.cluster -
     NEWNAME(example.testiam.cluster)
 ALTER example.myiam.aix -
     NEWNAME(example.testiam.aix)
 ALTER example.myiam.path -
     NEWNAME(example.testiam.path)
 DEFINE ALTERNATEINDEX -
      (NAME(example.testiam.aix)    -
      RELATE(example.testiam.cluster) -
      VOLUME(ANYVOL)  -
      RECATALOG )
  DEFINE PATH   -
      (NAME(example.testiam.path) -
      PATHENTRY(example.testiam.aix) -
      RECATALOG )
 LISTCAT ENT(example.testiam.cluster) ALL
 LISTCAT ENT(example.testiam.aix)     ALL
 LISTCAT ENT(example.testiam.path)    ALL
/*

Example C1: Renaming a Linear Data Set

In this example, an IAM Encrypted Linear Data Set is being renamed. Both the Base Cluster Name and the Data Component name must be renamed.

Example of Renaming Encrypted Linear Data Set (EX1083C1)

//*
//*    EX1083C1:  EXAMPLE OF RENAMING LINEAR DATASET
//*
//RENLINAR EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
/*  RENAME LINEAR BASE CLUSTER NAME  */
   ALTER EXAMPLE.MYIAM.IVTK1 -
   NEWNAME(EXAMPLE.TESTIAM.IVTK1)
/*                                     */
/*  RENAME LINEAR DATA COMPONENT NAME  */
   ALTER EXAMPLE.MYIAM.IVTK1.$IAM -
   NEWNAME(EXAMPLE.TESTIAM.IVTK1.$IAM)
/*

Example D: Rename Using IAM ISPF Panels

The IAM ISPF panels can also be used to rename IAM data sets, and will automatically perform the necessary recatalog. The rename function is used by selecting option R on the primary IAM panels, and indicating the name of the data set to be renamed, along with the new name. An example of a completed rename panel is shown below, which will rename the data set MYIAM.CLUSTER to TESTIAM.CLUSTER.

Example of IAM ISPF Rename

inset_18.jpg

For IAM files that are part of an Alternate Index association, the following panel will appear requesting confirmation to proceed with the recatalog function. In the upper right hand corner, a message displays that the rename is completed. To proceed with the recatalog function, make sure that the Perform Recatalog is set to YES.

Example of IAM ISPF Recatalog Confirmation Panel

inset_12.jpg

inset_19.jpg

On completion of the recatalog, IAM will re-display the primary IAM panel, with a message in the upper right corner that the recatalog was ok. You can display the renamed data set and associated components for the association information to verify that the new associations were updated properly.

Display of AIX with renamed base cluster

inset_11.jpg



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*