Page 1 of 1

rename a static part of a dynamic file.

Posted: Fri Aug 03, 2018 5:51 am
by Binamra
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.

Re: rename a static part of a dynamic file.

Posted: Fri Aug 03, 2018 6:46 am
by Robert Sample
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.

Re: rename a static part of a dynamic file.

Posted: Fri Aug 03, 2018 2:52 pm
by nicc
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.

Re: rename a static part of a dynamic file.

Posted: Mon Sep 24, 2018 12:05 pm
by Binamra
Thanks both. I shall work on this suggestion.