I have a odd requirement to replace a part of the string that has been found after a search in JCL members.

eg. say in a member WASH we have the following lines.//// STATE='WA'// TYPE='MART'....etcI have to find the word 'TYPE=' and then replace the last part to say 'U1' so it should become.//// STATE='WA'// TYPE='MAU1'....etc

or if the input is // TYPE='RITE' it should become // TYPE='RIU1'the requirement might look straight forward, but the problem is that the position of TYPE= is not definite, it could be anywhere from 5 to 20.

Can anyone suggest a workaround. I have to use FILEAID, because I have to apply this replace on multiple members of a PDS.Let me know if there any questions or clarifications required.

Hi, I found Fileaid easy too update members od PDS. I have to do it via utility and thought REPLACE/REPLACEALL could help me. But it was not giving me the exact result because the position of the string varies.

Hi, We have SYNCSORT in our system. Maybe a dump question, but can SORT run across members of a PDS like FILEAID can, especially all members that have a similar name. Say I want to run the replace across members with ABC. FILEAID has the option to run on members with ABC* . I do not mind using SORT or other tool that can help me get to that.

Ya, it is not a business requirement. I am trying this to automate a process. I am trying to avoid COBOL, so as that if I have to make changes, I do not have to code, compile, version control, proc search and also see that all have access to that lib etc..

Rexx can be option, I am new to it and have not done much programming in it. I am looking to that too.

No, not that i'm aware of. Neither would cobol. Both would need an execute per member. REXX code could navigate the pds and select only the members that match the pattern you want.

so as that if I have to make changes, I do not have to code, compile, version control, proc search and also see that all have access to that lib etc..

No matter how this "code" is implemented, it should be documented and promoted . . . It is a very poorly managed environment/system that allows code to be used in production that is not managed just like other "real" code.

I will start reading some REXX manuals to code for this.while I get to writing up the code, we can see if anybody else has faced a similar issue and found a work around using FILEAID or some other utility.

This code that I intend to write is not a prod code. It is just for automation purpose for a short term goal.

You're welcome. I'll keep an eye out and if i see any examples that might help, i'll post them.

I beliee the first order of business is finalizing the rules about which members are selected, which actions would be made for any different rules, and lastly the rules for how the output should be created.

If thre others who have some mainframe rexx experience, they may be able to quickly get you started by showing which system data sets are used in your environment.