Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Find string withn PDS member & replace value frm anothr

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

New User


Joined: 25 Dec 2008
Posts: 35
Location: India

PostPosted: Wed Apr 27, 2011 10:28 pm    Post subject: Find string withn PDS member & replace value frm anothr
Reply with quote

I have few PDS (one for each application), containing multiple members with directory paths in those (for FTP purpose). I need to write a job or utility, that would scan through each member in the PDS and find lines having 'cd' command. When such a line is encountered, I need to get the directory path against the cd command, check it against another file (which will have new mappings) and accordingly replace the path within the member from input. I have done some research on File-Aid but it seems like File-Aid can be used effectively only, if the changes to be done have more or less, the same format (in this case paths would be different in each member and hence length of string to be replaced would keep changing). Moreover, I didn't get any option of looking up against another input file. So I think the only other option may be to use REXX commands.

Could anyone please suggest any possible approach?
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


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

PostPosted: Wed Apr 27, 2011 10:51 pm    Post subject:
Reply with quote

An edit macro might be a better choice than Rexx. However, as you have asked for Rexx...

Read the sorted mappings into stems. Allocate the member to be changed to, e.g., TULUT1. Read each record from TULUT1; search the record for the command (using POS to search for "CD " seems like a good bet to me). If the record needs to be changed, find the directory in the old map stem; get the corresponding new directory from the new map stem. Create an output record by concatenating the beginning and end of the record on either side of the directory. Write the record (changed to not) to a temporary data set or member. When the entire member has been read, copy the temporary over it.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2088
Location: Silicon Valley

PostPosted: Thu Apr 28, 2011 2:19 am    Post subject: Reply to: Find string withn PDS member & replace value f
Reply with quote

I agree an editor macro might be easier. Something like this:

1. exclude all lines
2. FIND 'cd' ALL WORD
3. CHANGE '/old1' '/new1' ALL NX
4. CHANGE '/old2' '/new2' ALL NX

and repeat #3 as needed. That is, move the old and new directories into the macro. This would be a manual cut and paste... not elegant programming, but you could be done in a few minutes.

Then run the macro for each member of each PDS.
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
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts String after '.' (period) is not copy... balaji81_k SYNCSORT 6 Wed Aug 23, 2017 9:35 pm
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us