FILEAID to REPLACE/EDIT string



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

FILEAID to REPLACE/EDIT string

Postby akanchu » Thu Mar 26, 2009 4:13 am

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'
..
..etc
I 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.
akanchu
 
Posts: 36
Joined: Fri Jan 23, 2009 3:11 am
Has thanked: 0 time
Been thanked: 0 time

Re: FILEAID to REPLACE/EDIT string

Postby dick scherrer » Thu Mar 26, 2009 4:49 am

Hello,

I have to use FILEAID, because I have to apply this replace on multiple members of a PDS.
Suggest you get a clarification on this. FileAid has no relationship to members of a pds. . . :?
Can anyone suggest a workaround.
If it was my requirement, i'd write a few lines of cobol. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: FILEAID to REPLACE/EDIT string

Postby akanchu » Thu Mar 26, 2009 5:11 am

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.

Is there some other tool that can help me achieve the same thing.

Thanks
akanchu
 
Posts: 36
Joined: Fri Jan 23, 2009 3:11 am
Has thanked: 0 time
Been thanked: 0 time

Re: FILEAID to REPLACE/EDIT string

Postby dick scherrer » Thu Mar 26, 2009 6:19 am

Hello,

You should be able to do what you want with any coding language . . .

You might also be able to do what you want using the sort product that is in use on the system. Which sort product is in use?

You might also look into using rexx, but if you do not already know rexx, this might take far more time.

I have to do it via utility
That is not a business requirement. . . The business requirement is to correctly change the members.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: FILEAID to REPLACE/EDIT string

Postby akanchu » Thu Mar 26, 2009 6:51 am

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.

Thanks.
akanchu
 
Posts: 36
Joined: Fri Jan 23, 2009 3:11 am
Has thanked: 0 time
Been thanked: 0 time

Re: FILEAID to REPLACE/EDIT string

Postby dick scherrer » Thu Mar 26, 2009 7:39 am

Hello,

but can SORT run across members of a PDS like FILEAID can
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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: FILEAID to REPLACE/EDIT string

Postby akanchu » Thu Mar 26, 2009 9:01 am

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.

Thanks for your suggestion.
akanchu
 
Posts: 36
Joined: Fri Jan 23, 2009 3:11 am
Has thanked: 0 time
Been thanked: 0 time

Re: FILEAID to REPLACE/EDIT string

Postby dick scherrer » Thu Mar 26, 2009 9:23 am

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.

Good luck - there will be someone here when there are questions.

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post