View previous topic :: View next topic
|
Author |
Message |
mano
New User
Joined: 23 Mar 2006 Posts: 17 Location: chennai
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
mano
New User
Joined: 23 Mar 2006 Posts: 17 Location: chennai
|
|
|
|
There is no specific rule
if old member name is XXAB411C,
i have to change to XXCD411C |
|
Back to top |
|
|
gowtham_1982 Warnings : 1 Active User
Joined: 02 Dec 2005 Posts: 109
|
|
|
|
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 |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Sahoo
New User
Joined: 08 Jun 2006 Posts: 53
|
|
|
|
Use PGM=IEBCOPY with SELECT MEMEBER=((Oldname,newname,r) option |
|
Back to top |
|
|
Pollyannaish
New User
Joined: 09 Jul 2005 Posts: 31 Location: Pune, India
|
|
|
|
Hey SuperK
thanks for the code first..
Another note .. one can use overlay command for the required change logic |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Did you use TRACE to follow what is happening ? |
|
Back to top |
|
|
Jasand
New User
Joined: 23 Jan 2009 Posts: 32 Location: Tamil nadu
|
|
|
|
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 |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 580 Location: London
|
|
|
|
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 |
|
|
|