Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Rename all members in a PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
mano

New User


Joined: 23 Mar 2006
Posts: 17
Location: chennai

PostPosted: Wed May 10, 2006 12:17 pm    Post subject: Rename all members in a PDS
Reply with quote

Hi
I have around 200 members in a PDS and i have to change the member names to new member name.
Is there any way to automate this process.
i.e. is there is any ispf command or jobs to change the member names at one shot.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed May 10, 2006 3:40 pm    Post subject: Re: Rename all members in a PDS
Reply with quote

Is there some sort of rule that needs to be followed for the new member names?

What I mean is, if you have generated the list of current member names, can you just read through the list and automatically run a TSO RENAME command for each member?
Back to top
View user's profile Send private message
mano

New User


Joined: 23 Mar 2006
Posts: 17
Location: chennai

PostPosted: Wed May 10, 2006 5:00 pm    Post subject: Rename all members in a PDS
Reply with quote

There is no specific rule
if old member name is XXAB411C,
i have to change to XXCD411C
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Thu May 11, 2006 8:54 am    Post subject: Re: Rename all members in a PDS
Reply with quote

superk wrote:
Is there some sort of rule that needs to be followed for the new member names?

What I mean is, if you have generated the list of current member names, can you just read through the list and automatically run a TSO RENAME command for each member?



Hi Superk,

Can you please share more info on TSO RENAME command? I tried in my shop and its wanting to specify the DS name. How to go about for renaming the members of the DS?

Kind regards,

Gowtham
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Thu May 11, 2006 8:58 am    Post subject:
Reply with quote

Hi Gowtham,

It will ask the DS name so you give the PDS name it will RENAME the PDS. Not all the members in the PDS.

I never tried to rename the member in the PDS through that command.

If superK give more info we can try
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu May 11, 2006 5:42 pm    Post subject: Re: Rename all members in a PDS
Reply with quote

Here's a quick little REXX exec that demonstrates what I'm talking about. It presumes that the PDS name is 'USERID.PDS', and that you want to rename each member with an 'at' sign (@) in front of the current name:

Code:

/* REXX */                                           
thepds = SYSVAR(SYSUID)'.PDS'                       
Call Outtrap('l.')                                   
"LISTDS '"thepds"' MEMBERS"                         
Call Outtrap('Off')                                   
Do loop = 7 To l.0                                   
  oldmem = Strip(l.loop)                             
  newmem = '@'oldmem                                 
  "RENAME '"thepds"("oldmem")' '"thepds"("newmem")'"
  If rc = 0 Then Say oldmem newmem                   
End                                                 


Here's an equivelent exec using ISPF Library Management services:
Code:

/* REXX */                                                       
thepds = SYSVAR(SYSUID)'.PDS'                                     
"ISPEXEC LMINIT DATAID(dataid) DATASET('"thepds"') ENQ(SHRW)"     
"ISPEXEC LMOPEN DATAID("dataid") OPTION(OUTPUT)"                 
oldmem = ""                                                       
Do Forever                                                       
  "ISPEXEC LMMLIST DATAID("dataid") OPTION(LIST) MEMBER(oldmem)" 
  If rc <> 0 Then Leave                                           
  newmem = '@'oldmem                                             
  "ISPEXEC LMMREN DATAID("dataid") MEMBER("oldmem")",             
    "NEWNAME("newmem") NOENQ"                                     
  Say oldmem newmem                                               
End                                                               
"ISPEXEC LMCLOSE DATAID("dataid")"                               
Exit 0                                                           
Back to top
View user's profile Send private message
Sahoo

New User


Joined: 08 Jun 2006
Posts: 53

PostPosted: Sun Jun 25, 2006 3:31 pm    Post subject: Re: Rename all members in a PDS
Reply with quote

Use PGM=IEBCOPY with SELECT MEMEBER=((Oldname,newname,r) option
Back to top
View user's profile Send private message
Pollyannaish

New User


Joined: 09 Jul 2005
Posts: 31
Location: Pune, India

PostPosted: Mon May 21, 2007 11:27 am    Post subject:
Reply with quote

Hey SuperK
thanks for the code first..

Another note .. one can use overlay command for the required change logic
Back to top
View user's profile Send private message
giraffe

New User


Joined: 09 Nov 2010
Posts: 28
Location: SHENZHEN CHINA

PostPosted: Wed Apr 06, 2011 5:27 pm    Post subject: Re: Rename all members in a PDS
Reply with quote

Hi, can you tell me if i should specify host command environment, i execute the first exec, but there's no response and my pds members were not renamed, I'm a tyro in rexx.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Apr 06, 2011 5:39 pm    Post subject: Reply to: Rename all members in a PDS
Reply with quote

I don't understand your question at all, but if you could post some output from a run-time TRACE, that would be helpful.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Apr 06, 2011 5:40 pm    Post subject:
Reply with quote

Did you use TRACE to follow what is happening ?
Back to top
View user's profile Send private message
Jasand

New User


Joined: 23 Jan 2009
Posts: 32
Location: Tamil nadu

PostPosted: Tue Apr 26, 2011 6:24 pm    Post subject:
Reply with quote

Hi Mano,
We can do mask renaming of the members in a PDS through FILE-AID.

The PDS Processing Options (PPO) screen lets you define a subset of members to be copied based on member name and can be used to specify member renaming for copied members.

START M;FA;3.3
> Give the FROM and TO PDS names. Then you will be navigated to the below screen,


Code:
 File-AID ----------------- PDS Processing Options -----------------------------
 COMMAND ===>                                                                   
                                                                               
 FROM Dataset: XXXXX.PDS.NAME                                             
     Copy entire member            ===> Y        (Y = Yes;                     
                                                  N = No, selected records only)
     Copy empty members            ===> N        (Y = Yes; N = No)             
     Process in JCL format         ===> N        (Y = Yes; N = No)             
                                                                               
 TO Dataset:   XXXXX.NEWPDS.NAME
     Replace like-named members    ===> Y        (Y = Yes; N = No)             
                                                                               
     Rename copied members mask    ===>                                         
                                                                               
 Specify Member Selection Options (Blank for All Members)                       
     Member name mask              ===>                                         
     Member name range             ===>          to ===>                       
     Last modified userid          ===>          to ===>                       
     Creation date                 ===>          to ===>          (YY/MM/DD)   
     Modification date             ===>          to ===>          (YY/MM/DD)   
                                                                               
     Display member selection list ===> Y        (Y = Yes; N = No)             
                                                                               
 Use ENTER to continue, END to return to copy utility screen     



Use the option Rename copied members mask ===>
for eg: Rename copied members mask ===> NEW?????

The question mark (?) in NEW????? in the “Rename copied members mask” field implies to keep original member name character.

Therefore a member AAA12345 will be renamed to NEW12345 in the new PDS created. AFter getting a fresh PDS with the new member names, you may delete the old PDS.
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Mon May 23, 2011 4:43 pm    Post subject:
Reply with quote

IDCAMS ALTER is another option

//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ALTER DATA.SET.NAME(MEMBER) -
NEWNAME(DATA.SET.NAME(NEWMEMBA)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Generic rename by pattern‏ Steve Coalbran CLIST & REXX 6 Mon May 30, 2016 9:34 pm
No new posts Single step utility for compare and u... ramprakashn JCL & VSAM 5 Fri Apr 29, 2016 3:43 pm
No new posts Differences between copying members b... E.LAI TSO/ISPF 8 Wed Mar 30, 2016 12:35 pm
No new posts IEHPROGM - HOW TO RENAME A PDS ? WagnerBil IBM Tools 7 Wed Aug 12, 2015 6:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us