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

Renaming Members of a PDS/PDSE with Wildcards


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
fesar

New User


Joined: 30 May 2008
Posts: 2
Location: Chennai

PostPosted: Fri Jan 27, 2012 4:34 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jan 27, 2012 4:51 pm
Reply with quote

not out of the box,
but searching the forum for MEMBER RENAME will return a few topics with hints on how to do it
for example
ibmmainframes.com/viewtopic.php?t=10936&highlight=pds+member+rename
Back to top
View user's profile Send private message
fesar

New User


Joined: 30 May 2008
Posts: 2
Location: Chennai

PostPosted: Fri Jan 27, 2012 6:12 pm
Reply with quote

Thanks a lot. Will try out that options. If there are any other options someone got do let me know.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jan 27, 2012 6:27 pm
Reply with quote

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
View user's profile Send private message
nkumar

New User


Joined: 09 Mar 2008
Posts: 28
Location: USA

PostPosted: Sat Jan 28, 2012 12:31 am
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Sat Jan 28, 2012 12:53 am
Reply with quote

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
View user's profile Send private message
nkumar

New User


Joined: 09 Mar 2008
Posts: 28
Location: USA

PostPosted: Sat Jan 28, 2012 2:10 am
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Sat Jan 28, 2012 2:24 am
Reply with quote

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
View user's profile Send private message
nkumar

New User


Joined: 09 Mar 2008
Posts: 28
Location: USA

PostPosted: Sat Jan 28, 2012 2:32 am
Reply with quote

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. icon_smile.gif icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Jan 28, 2012 2:45 am
Reply with quote

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
View user's profile Send private message
nkumar

New User


Joined: 09 Mar 2008
Posts: 28
Location: USA

PostPosted: Sat Jan 28, 2012 2:50 am
Reply with quote

Quote:
that means when everything goes haywire, you can blame someone else.


How did you come to this conclusion?
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
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
Search our Forums:

Back to Top