| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| info_seeker Beginner
 
 
 Joined: 31 Jan 2005
 Posts: 27
 Topics: 9
 
 
 | 
			
				|  Posted: Thu Jan 19, 2006 3:18 pm    Post subject: Rename members of PDS with search criteria |   |  
				| 
 |  
				| Hi, 
 I have 100 members in a PDS. I want to replace the first two characters of member names, whose names meet a specific criteria. For eg: all the memebrs whose name is starting with TU needs to be changed to PR. Is there a way to tackle this?
 
 Cheers!
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| German Castillo Beginner
 
  
 Joined: 23 Dec 2005
 Posts: 83
 Topics: 2
 Location: Caracas, Venezuela
 
 | 
			
				|  Posted: Thu Jan 19, 2006 3:39 pm    Post subject: |   |  
				| 
 |  
				| hi Info Seeker 
 The first part is easy, determine which members meet your criteria, this rexx should work or at least give you the starting point to do it:
 
 
  	  | Code: |  	  | /*Rexx*/
 ...
 /*place your dsn in the DSN Var*/
 x = Outtrap('Mem.')
 "LISTD '"Dsn"' MEMBERS"
 x = Outtrap('OFF')
 
 Do iMem = 1 To Mem.0
 If Mem.iMem = "--MEMBERS--" Then Leave
 End
 
 Do iMem = iMem + 1 To Mem.0
 If Left( Mem.I, 2) /= "TV" Then iterate
 Call Rename
 End
 ....
 
 rename:
 ...
 
 
 | 
 
 Now for the rename procedure you can do several things,
 a) to generate IEBCOPY SYSIN cards to be execute after the current step finishes, of course this sysin cards should have the proper IEBCOPY with the rename parms, maybe the original member will stay as well.
 
 b) Use any other renaming program
 
 c) use the LMM* ISPF services to do it inside the Rexx procedure
 _________________
 Best wishes,
 
 German Castillo
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ofer71 Intermediate
 
 
 Joined: 12 Feb 2003
 Posts: 358
 Topics: 4
 Location: Israel
 
 | 
			
				|  Posted: Thu Jan 19, 2006 4:10 pm    Post subject: |   |  
				| 
 |  
				| Hi - 
 I wrote a REXX utility with the following capabilities:
 - Renaming members based on patterns and positions of characters.
 - Batch or online invocation.
 - Implemnting the renamed member names in the source of other library (for example - if you rename members in PROC library, you may want to change you JCL sources, too)
 - Full log capabilities.
 
 It it quite big, so I can't put it here, but if you want it, give me your maill address and I'll send it to you.
 
 O.
 ________
 Chrysler ecoVoyager
 
 Last edited by ofer71 on Sat Feb 05, 2011 11:29 am; edited 1 time in total
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| info_seeker Beginner
 
 
 Joined: 31 Jan 2005
 Posts: 27
 Topics: 9
 
 
 | 
			
				|  Posted: Fri Jan 20, 2006 11:17 am    Post subject: |   |  
				| 
 |  
				| Hey Ofer71, 
 Could you please sent that to hercules7931@yahoo.com.
 
 Help much appreciated.
 
 Cheers!!!
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Fri Jan 20, 2006 11:23 am    Post subject: |   |  
				| 
 |  
				| info_seeker, 
 Do you have fileaid at your shop?
 
 Kolusu
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| info_seeker Beginner
 
 
 Joined: 31 Jan 2005
 Posts: 27
 Topics: 9
 
 
 | 
			
				|  Posted: Wed Jan 25, 2006 3:14 pm    Post subject: |   |  
				| 
 |  
				| Yes.. Kolusu.. We have File Aid. Do you have any solution with that? |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| info_seeker Beginner
 
 
 Joined: 31 Jan 2005
 Posts: 27
 Topics: 9
 
 
 | 
			
				|  Posted: Fri Jan 27, 2006 2:32 pm    Post subject: |   |  
				| 
 |  
				| Hi Kolusu, 
 I foud the method to do that with fileaid.
 The following instream card worked for chaging members starting with V0P1 to N0T3
 $$DD01 COPYMEM PADCHAR=X'00',CEM=NO,RLM=YES,
 NEWMEMS=N0T3????,
 MEMBER=(V0P1XX1,V0P1XXX2,V0P1XXX3,V0P1XXX4,V0P1XXX5,
 V0P1XXX6,V0P1XXX8,V0P1XXX9)
 
 You guided me Kolusu.. Thank you so much...
 Thanks to Ofer for sending the REXX. That was an amazing tool... Three Cheers!!!
 
 -Info Seeker
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |