Renaming IAM Data Sets
You can rename IAM data sets 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 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)
//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)
//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)
//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
OPTION ===> r
I - Allocate (DEFINE) a new IAM Dataset Ver 11.0.00
V - Allocate (DEFINE) a new VSAM Cluster
D - Delete a Dataset, Cluster, Path, or Alternate Index
C - Copy an IAM Dataset, VSAM KSDS, or VSAM ESDS
M - Move an IAM Dataset, VSAM KSDS, or VSAM ESDS
R - Rename a Dataset, Cluster, Path, or Alternate Index
U - Invoke an IAM Utility program
blank - Display IAM Dataset or VSAM Cluster Information
Enter dataset name (required for all options except U)
Dataset Name ===> CPPRAC.IVTK1
Dataset Type ===> C C=Cluster X=AIX P=Path (options I, V Only)
Enter Model or New dsname (optional for options I and V, required for option R)
Model|Newname ===> CPPRAC.IVTK1A
Delete Confirmation ===> YES Yes|No
View IDCAMS statements ===> NO Yes|No|Only
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
COMMAND ===>
New Dataset Name... CPPRAC.IVTK1A
The above dataset that has been renamed is associated with an IAM
Alternate Index or Path and needs to be RECATALOGED so IAM can
maintain the correct relationships with associated datasets.
Perform RECATALOG ===> YES (Yes/No)
OPTION ===>
I - Allocate (DEFINE) a new IAM Dataset Ver 11.0.00
V - Allocate (DEFINE) a new VSAM Cluster
D - Delete a Dataset, Cluster, Path, or Alternate Index
C - Copy an IAM Dataset, VSAM KSDS, or VSAM ESDS
M - Move an IAM Dataset, VSAM KSDS, or VSAM ESDS
R - Rename a Dataset, Cluster, Path, or Alternate Index
U - Invoke an IAM Utility program
blank - Display IAM Dataset or VSAM Cluster Information
Enter dataset name (required for all options except U)
Dataset Name ===> CPPRAC.IVTK1A
Dataset Type ===> C C=Cluster X=AIX P=Path (options I, V Only)
Enter Model or New dsname (optional for options I and V, required for option R)
Model|Newname ===>
Delete Confirmation ===> YES Yes|No
View IDCAMS statements ===> NO Yes|No|Only
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
COMMAND ===>
Dataset Name: CPPRAC.IVTK1.AIX
More: +
Definition Information Allocation Information
Record Length: 40 Volume: SYTS11
Record Format: VARIABLE Device Type: 3390
Key Len/Offset: 4 / 5 Tracks in use: 2
Key Offset(BASE): 8 Block Size: 13682
Spanned Recs: Blocking Factor: 4
Unique Keys: YES Alloc Type: TRACKS
Upgrade: YES Primary Alloc: 30
Share Option: 1 Secondary Alloc: 10
Release: NO
Storage Class: TSTDATA
Data Class:
Mgmt Class:
Statistics Extended Area Information
Creation: 2022.350 Overflow Records: 0
Expiration: 0000.000 Blocks Allocated: 0
Last Reference: 2022.350 Blocks Used: 0
Records: 2000 Overflow Blocks: 0
Deletes: 0 PE Blocks: 0
Inserts: 0 Blocks Available: 0
Updates: 0 Variable Overflow: YES
----------------- IAM Alternate Index File Characteristics ------------------
COMMAND ===>
Dataset Name: CPPRAC.IVTK1.AIX
More: -
Statistics Extended Area Information
Creation: 2022.350 Overflow Records: 0
Expiration: 0000.000 Blocks Allocated: 0
Last Reference: 2022.350 Blocks Used: 0
Records: 2000 Overflow Blocks: 0
Deletes: 0 PE Blocks: 0
Inserts: 0 Blocks Available: 0
Updates: 0 Variable Overflow: YES
Minimum Buffers:
Maximum Buffers:
Associations
CLUSTER-CPPRAC.IVTK1A
AIX-CPPRAC.IVTK1.AIX
PATH-CPPRAC.IVTK1.PATH