Hi,
Can anyone please help me as I am having a requirement to rename a static part of a dynamic file like from
AB.CD.EF.GH.IJ (where GH & IJ will Change randomly daily)
To
AB.XY.EF.GH.JI
Means changing from CD to XY using JCL or REXX.
rename a static part of a dynamic file.
Moderator: mickeydusaor
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: rename a static part of a dynamic file.
First, understand that this cannot be done with JCL. JCL is used to set up environments and execute programs -- it cannot sort (that requires DFSORT or SYNCSORT), it cannot copy a data set (that requires IDCAMS or IEBGENER or IEBCOPY or ....), it cannot do anything but allocate / deallocate / delete data sets and execute programs.
If I needed to do this, first I'd find out why a generation data group is not being used. GDGs are designed for this type of processing and should be the preferred method. Then I would set up an IDCAMS LISTCAT LEVEL(AB.CD.EF) that output to a temporary data set; the next step would take the temporary data set as input, parse out the data set names, and then create the rename(s) either by using batch TSO commands or creating a job stream to submit through the internal reader.
If I needed to do this, first I'd find out why a generation data group is not being used. GDGs are designed for this type of processing and should be the preferred method. Then I would set up an IDCAMS LISTCAT LEVEL(AB.CD.EF) that output to a temporary data set; the next step would take the temporary data set as input, parse out the data set names, and then create the rename(s) either by using batch TSO commands or creating a job stream to submit through the internal reader.
Re: rename a static part of a dynamic file.
Or you could back up, using your backup software, the AB.CD.EF.GH.IJ data sets and restore them using the rename option. However, Robert is correct, as usual, and GDGs were designed for just this sort of naming requirements.
Regards
Nic
Nic
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute