There are no arrays in z/OS rexx - you are using stems.
You can use EXECIO to read 1 or many or all lines at a time. The same with writing.
There are several approaches to doing what you want. For example:
. read/write line by line
.read into a stem and copy the lines that you want to another stem and write that.
.have a mixture of the first two e.g. bulk read/write by line
This makes no sense:
DO K = TAB1.0 TO 1
ADDRESS TSO "ALLOC FI(IN) DA('"MEM1"') SHR REUSE"
ADDRESS TSO "EXECIO "TAB1.0" DISKW IN (STEM TAB1. FINIS"
ADDRESS TSO "FREE F(IN)"
END
I do not know what you are intending to do here but it is probably not doing what you want.
Your process should be:
.get a list of members and store in stem - let's call it members.
.loop through each member
.allocate the member
.read it into a stem - let's call it memb_lines.
.loop through each line
.if the line is required:
.change line if a change is required
.write line to output stem - lt us call it lines_out.
.end loop through memb_lines
.write the output stem - lines_out.
.free the member
.end loop through member. stem
.end program
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic