Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Rexx program to replace a string for a member in PDS.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
prarthana

New User


Joined: 12 Mar 2006
Posts: 21

PostPosted: Wed Aug 23, 2006 9:15 pm    Post subject: Rexx program to replace a string for a member in PDS.
Reply with quote

Hi,
Can some1 give the oce for Rexx program to replace a string for a particular member in a PDS.

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

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Aug 23, 2006 9:29 pm    Post subject: Re: Rexx program to replace a string for a member in PDS.
Reply with quote

String replacement is usually a whole lot easier to do with an editor (TSO EDIT or ISPF EDIT) rather than writing your own code. Any particular reason you want to use REXX instead?

At a high level, I think you'd want to:

find the position of the string within the current record, then overlay the replacement string at that same position.
Back to top
View user's profile Send private message
prarthana

New User


Joined: 12 Mar 2006
Posts: 21

PostPosted: Wed Aug 23, 2006 10:35 pm    Post subject: Re: Rexx program to replace a string for a member in PDS.
Reply with quote

Yes I agree.
But I have around 500 jobs where I will have to replace parms/procs for test with that of production parms/procs.

Do you have any other suggestions other than REXX for this?

Thanks.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Aug 23, 2006 11:14 pm    Post subject: Re: Rexx program to replace a string for a member in PDS.
Reply with quote

Since I don't know what your data looks like, I can't answer. Let me reiterate that this is an easy task using an editor. If the string to be replaced is in a consistent position, and is being replaced with another string of the same length, then any utility such as SORT or SAS or Easytrieve or even Fileaid or File Manager or yes, REXX, can easily handle such as task.

An easy string replacement routine in REXX that doesn't care about the position of the string within the record:
Code:

/* REXX */                                           
E = 'THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG'   
STRNGPTRN = 'FOX '                                   
STRNGREPL = 'FX '                                   
SAY E                                               
SAY LENGTH(E)                                       
PARSE VAR E L (STRNGPTRN) R                         
IF LENGTH(E) <> LENGTH(L) THEN E = L||STRNGREPL||R   
SAY E                                               
SAY LENGTH(E)                                       
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Aug 23, 2006 11:54 pm    Post subject:
Reply with quote

What wrong with the following Edit-Macro (which is written in REXX)?
Code:
/* REXX */

ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "C ALL 'PROD' 'TEST' 8 11"
ADDRESS ISREDIT "END"
 
EXIT


O.
Back to top
View user's profile Send private message
prarthana

New User


Joined: 12 Mar 2006
Posts: 21

PostPosted: Thu Aug 24, 2006 8:40 pm    Post subject: Re: Rexx program to replace a string for a member in PDS.
Reply with quote

Thanks.
I have a member in PDS (PRARTHANA.RUN.JCLS) - member1

The member has this piece of code


// JCLLIB ORDER=(MBCT.CA7.SIT001.PROCLIB,
// NBSP.NBS1S.PROCLIB,
// NBSP.NBS.SYS.PROCLIB)


now whereever I have MBCT.CA7.SIT001.PROCLIB, I have to replace this with NBSP.NBS.PROCLIB. I have around 20 other replacements similar to this one.
Does this give you an idea of what I want?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Aug 24, 2006 11:54 pm    Post subject:
Reply with quote

Have you seen my example?

O.
Back to top
View user's profile Send private message
prarthana

New User


Joined: 12 Mar 2006
Posts: 21

PostPosted: Fri Aug 25, 2006 1:50 am    Post subject: Re: Rexx program to replace a string for a member in PDS.
Reply with quote

Yes
But I need to edit a particular member in a PDS.
Will that work?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Fri Aug 25, 2006 1:53 pm    Post subject:
Reply with quote

Why not?

O.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Fri Aug 25, 2006 5:58 pm    Post subject: Re: Rexx program to replace a string for a member in PDS.
Reply with quote

Sorry, but why not using IPOUPDTE ???
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us