MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To replace a string in entire PDS

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sudhtech27
Beginner


Joined: 07 Oct 2003
Posts: 8
Topics: 6

PostPosted: Tue Oct 07, 2003 5:09 am    Post subject: To replace a string in entire PDS Reply with quote

Hi,

I have a PDS which has around 120 members in it. Our requirement is to search in all members of this PDS having file name with NABS32.PRDKY.TEST to NABS32.PRDX.Test
Can anyone suggest a Quick solution for this ?
I tried file aid search and update option and I could n't get expected result.

Thanks!
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Tue Oct 07, 2003 5:51 am    Post subject: Reply with quote

Hi

Create a REXX like this, and name it whatever you like:
Code:
/* REXX */                                                           
                                                                     
MAC  = 'TEMPMAC'                                                     
PDS  = "'your.pds'"                                       
                                                                     
                                                                     
X = OUTTRAP("LIBMEM.")                                               
 ADDRESS TSO "LISTDS "PDS" M"                                         
X = OUTTRAP("OFF")                                                   
                                                                     
PDS = STRIP(PDS,"B","'")                                             
                                                                     
DO I = 7 TO LIBMEM.0                                                 
  LIBMEM.I = STRIP(LIBMEM.I)                                         
  ADDRESS ISPEXEC "EDIT DATASET ('"PDS"("LIBMEM.I")') MACRO ("MAC")" 
END                                                                   
                                                                     
EXIT                                                                 
                                                                     


Create another REXX, and name it TEMPMAC:
Code:

/* REXX */                         
                                   
ADDRESS ISREDIT "MACRO PROCESS"   
ADDRESS ISREDIT "C ALL PRDKY PRDX"
ADDRESS ISREDIT "SAVE"             
ADDRESS ISREDIT "END"             
                                   
EXIT                               


HTH

O.
________
buy silver surfer vaporizer


Last edited by ofer71 on Sat Feb 05, 2011 11:06 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Oct 07, 2003 6:09 am    Post subject: Reply with quote

sudhtech27,

Code:

//STEP0100 EXEC PGM=FILEAID                                 
//*                                                         
//SYSLIST  DD SYSOUT=*                                     
//SYSPRINT DD SYSOUT=*                                     
//SYSUDUMP DD SYSOUT=*                                     
//DD01     DD DSN=YOUR PDS,                         
//            DISP=SHR                                     
//SYSIN    DD *                                             
$$DD01 UPDATE,                               
              EDITALL=(1,0,C'NABS32.PRDKY.TEST',C'NABS32.PRDX.Test'),PDSSTAT=A
/*


Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group