Wow, this topic is going to be hard to answer, since the content is rather vague, and there are a lot of possibilities to consider.
So, you have a PDS and you want to read the members. To do this, you're going to have to generate a member list so you can write a loop to process the members as desired. If you refer to this website
you'll see an example of how to read the PDS directory blocks directly using native REXX. In TSO/E, the LISTDS
command will create a member list. Using ISPF Services, the LMMLIST Service
will do the same.
If you then want to read each member one-by-one, in TSO/E you'll have to first ALLOCATE
the PDS with the member:
ALLOCATE DD(MYPDS) DA('PDS(MEMBER)') SHR REUSE
and then you can read the DD as needed. In other environments, if TSO ALLOCATE won't work, then it may be possible to use the BPXWDYN
Dynamic Allocation utility instead.
In ISPF, you have the option of using the LMGET Service
The other part of your post mentions that you want to change text from one string to another. Without knowing more about your requirements, I can only suggest that you look into the possibility of editing the member and changing the string globally, with a pseudo-command like 'CHANGE ABC to XYX ALL' . This would give you the flexibility of dealing with unqeual-length and/or mixed-case strings. Again, edits can be done with the TSO/E EDIT
command, or with the ISPF EDIT Service
combined with an ISPF EDIT Macro
. Otherwise, in CLIST or REXX you can use standard text-processing functions like SUBSTR. In REXX you have more functions like PARSE