View previous topic :: View next topic
|
Author |
Message |
fesar
New User
Joined: 30 May 2008 Posts: 2 Location: Chennai
|
|
|
|
Hi,
Is there a way to Rename members of a PDS using Wild Cards. Like this
AAA.BBB.CCC(AAA*) to AAA.BBB.CCC(BBB*)
All the members starting with AAA will be renamed with BBB.
Currently in SAS this is being achieved by
PROC PDS; DDNAME
CHANGE AAAA:=BBBB:;
We are removing SAS and we need to do it with some other utility.
Regards,
Francis. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
fesar
New User
Joined: 30 May 2008 Posts: 2 Location: Chennai
|
|
|
|
Thanks a lot. Will try out that options. If there are any other options someone got do let me know. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
If there are any other options someone got do let me know. |
the remark is improper and impolite
we reply on our own time and free of charge
to expect people to reply is ...
the habit is to post solutions suited for a vanilla environment
( the zOS standard product set )
most probably there are products that might do that out of the box,
point them out is pretty useless, Your organization might not have them. |
|
Back to top |
|
|
nkumar
New User
Joined: 09 Mar 2008 Posts: 28 Location: USA
|
|
|
|
Here is a sample REXX code which I use to change the last 2 character of my member name present in a PDS. Conditions can be added for selective renaming.
Code: |
/* REXX */
/* GIVE THE I/P PDS */
INPUTPDS = give-inputpds
X = OUTTRAP('L.')
"LISTDS '"INPUTPDS"' MEMBERS"
X = OUTTRAP('OFF')
DO LOOP = 7 TO L.0
OLDMEM = STRIP(L.LOOP)
/*CHANGE THE ROUTE CODE */
NEWMEM = SUBSTR(OLDMEM,1,6)'9U'
"RENAME '"INPUTPDS"("OLDMEM")' '"INPUTPDS"("NEWMEM")'"
END |
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
nkumar wrote: |
Here is a sample REXX code which I use to change the last 2 character of my member name present in a PDS. Conditions can be added for selective renaming.
Code: |
/* REXX */
/* GIVE THE I/P PDS */
INPUTPDS = give-inputpds
X = OUTTRAP('L.')
"LISTDS '"INPUTPDS"' MEMBERS"
X = OUTTRAP('OFF')
DO LOOP = 7 TO L.0
OLDMEM = STRIP(L.LOOP)
/*CHANGE THE ROUTE CODE */
NEWMEM = SUBSTR(OLDMEM,1,6)'9U'
"RENAME '"INPUTPDS"("OLDMEM")' '"INPUTPDS"("NEWMEM")'"
END |
|
And what happens when the member name is less than six characters long? (Hint: nothing good.) |
|
Back to top |
|
|
nkumar
New User
Joined: 09 Mar 2008 Posts: 28 Location: USA
|
|
|
|
Quote: |
And what happens when the member name is less than six characters long? (Hint: nothing good.) |
This code was just meant to be an example. Obviously whoever wants to reuse, will have to tweak it as per his need. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
nkumar wrote: |
Quote: |
And what happens when the member name is less than six characters long? (Hint: nothing good.) |
This code was just meant to be an example. Obviously whoever wants to reuse, will have to tweak it as per his need. |
Well, it's certainly a comfort to me in my declining years to know that at least one sotfware engineer is comfortably ensconced in a environment where the names of PDS members are guaranteed to be at least six characters long. |
|
Back to top |
|
|
nkumar
New User
Joined: 09 Mar 2008 Posts: 28 Location: USA
|
|
|
|
Quote: |
Well, it's certainly a comfort to me in my declining years to know that at least one sotfware engineer is comfortably ensconced in a environment where the names of PDS members are guaranteed to be at least six characters long. |
Well..when you follow the standards life always become comfortable. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Well..when you follow the standards life always become comfortable. |
that means when everything goes haywire, you can blame someone else.
not my fault, i followed the rules..... |
|
Back to top |
|
|
nkumar
New User
Joined: 09 Mar 2008 Posts: 28 Location: USA
|
|
|
|
Quote: |
that means when everything goes haywire, you can blame someone else. |
How did you come to this conclusion? |
|
Back to top |
|
|
|