IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Rename all members in a PDS


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Wed May 10, 2006 3:40 pm
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
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
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: 174
Location: Bangalore

PostPosted: Thu May 11, 2006 8:58 am
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

Global Moderator


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

PostPosted: Thu May 11, 2006 5:42 pm
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
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
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: 27
Location: SHENZHEN CHINA

PostPosted: Wed Apr 06, 2011 5:27 pm
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

Global Moderator


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

PostPosted: Wed Apr 06, 2011 5:39 pm
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: 8797
Location: Welsh Wales

PostPosted: Wed Apr 06, 2011 5:40 pm
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
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 Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Mon May 23, 2011 4:43 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts list pds members name starting with xyz CLIST & REXX 11
No new posts REXX editmacro to compare two members... CLIST & REXX 7
No new posts Easy way to delete selected members f... IBM Tools 12
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
Search our Forums:

Back to Top