Monday, March 19, 2007

Renaming VSAM Datasets

Here's a quick and easy way to rename VSAM datasets and components in ISPF without having to retype all or part of the new name. It's especially useful if you have multiple datasets to rename:

1) Display the datasets you need to rename using option 3.4 or DSLIST.

2) Enter SHOWCMD ON on the command line. This will allow you to modify commands entered on the Dataset List panel before they're executed.

3) Tab down to the line with the dataset you want to rename, type the following and press Enter:
ALTER / NEWNM(/) Example:
------------------------------------------------------------------DSLIST - Data Sets Matching VTSUL.VTCMHCommand ===>
Command - Enter "/" to select action Message
------------------------------------------------------------------
alter / newnm(/) CMH.VT1001CT.NEWTICKT.MSTR VTSUL.VTCMH.VT1001CT.NEWTICKT.MSTR.DATA VTSUL.VTCMH.VT1001CT.NEWTICKT.MSTR.INDEX
------------------------------------------------------------------

4) When the expanded command is displayed, overtype the new dataset name in the NEWNM parameter field with your changes, and press Enter to execute the ALTER command. Example:
------------------------------------------------------------------
Data Set Name. : VTSUL.VTCMH.VT1001CT.NEWTICKT.MSTR
Command before expansion: ALTER / NEWNM(/)

Command after expansion:===>
ALTER 'VTSUL.VTCMH.VT1001CT.NEWTICKT.MSTR' NEWNM('VTSUL.VTCMH.VT1001CT.NEWICKT.MSTR')
----------------------
Remember, each component of a VSAM Cluster (DATA, INDEX, etc.) must be renamed individually.

5) Repeat the command for the remaining datasets and/or components using the '=' command.
This handy trick could also be used to perform other similar tasks... just use your imagination!


No comments:

Post a Comment