RENAME
Changes the name of a dataset or a member. The contents stay the same.
Also written REN
Why it matters. Names are how everything finds your work. When a name is wrong or out of date, RENAME fixes it without copying anything.
Syntax
{RENAME | REN} old-name new-name [ALIAS]
RENAME 'dsname(old-member)' (new-member)- old-name
- The dataset, or member, to rename.
- new-name
- The new name. For a member, give only the member name, in brackets.
- ALIAS
- Make the new member name an alias of the old member instead of renaming it.
- *
- One * in both names renames several datasets at once, for example RENAME *.DATA,*.TEXT.
Try it RENAME
- 1
Change the name of the member NOTES in your DEV.JCL library to OLDNOTES.
RENAME 'ZB0001.DEV.JCL(NOTES)' (OLDNOTES) - 2
Now rename the whole dataset ZB0001.DEV.WORK to ZB0001.DEV.OLDWORK.
RENAME 'ZB0001.DEV.WORK' 'ZB0001.DEV.OLDWORK' - 3
Try to rename ZB0001.DEV.CHECK to ZB0001.DEV.OLDWORK. That name is taken now.
RENAME 'ZB0001.DEV.CHECK' 'ZB0001.DEV.OLDWORK'
Remember
- Old name first, new name second.
- For a member, the new name is just the member part, in brackets.
- A name that is already taken is refused.
The usual mistake
RENAME 'ZB0001.DEV.JCL(NOTES)' (CUSTCHK)
A member called CUSTCHK is already in that library. A rename never writes over a member, so nothing changes.
Pick a name that is not used yet: RENAME 'ZB0001.DEV.JCL(NOTES)' (OLDNOTES)
On real z/OS
MF/OS renames one dataset or member at a time. ALIAS and the * form are not modelled. MF/OS prints a 'Mainframe101 sim:' note on success, where real TSO prints nothing, and a RACF refusal shows ICH408I and then IKJ58207I.
Where can I practise RENAME?
Right here, at ZedBank. You take a junior job at a simulated bank and use RENAME in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- DatasetWhat a mainframe calls a file: a named collection of records with a defined structure, rather than a loose stream of bytes.
- Partitioned datasetA dataset that works like a library or folder, holding many separately named members inside one dataset.
- MemberOne named item inside a partitioned dataset, such as a single program, job or copybook within a library.
- CatalogThe system's index of where datasets live, so you can refer to a dataset by name without knowing which disk it is on.
- High-level qualifierThe first part of a dataset name, which usually identifies the owner and drives how security and storage rules apply.