rename a static part of a dynamic file.

Time Sharing Option, Interactive System Productivity Facility and REstructured eXtended eXecutor

Moderator: mickeydusaor

Post Reply
Binamra
Registered Member
Posts: 67
Joined: Mon Jun 17, 2013 10:42 pm

rename a static part of a dynamic file.

Post 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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: rename a static part of a dynamic file.

Post 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.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: rename a static part of a dynamic file.

Post 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.
Regards
Nic
Binamra
Registered Member
Posts: 67
Joined: Mon Jun 17, 2013 10:42 pm

Re: rename a static part of a dynamic file.

Post by Binamra »

Thanks both. I shall work on this suggestion.
Post Reply

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

Register

Sign in

Return to “TSO, ISPF & REXX (Do you still do CLIST?!).”