Page 1 of 1

I would like a rexx to remove a specific line from a file.

PostPosted: Fri May 20, 2016 8:46 am
by sngxd
Hello folks

I code a program that open a file than read the file and send all records for a STEM .

I use this array to verify which line has a specific string

So I would like know one way to remove a line from the file that had this specific string.

I thought manipulate the array then remove the variable that contains this line so after that make an EXECIO DISKW to write the lines into files however if I drop the variable the variable will be recorded but without a value .

Conclusion :

I am looking for a way using rexx to remove a line from a file , or using EXECIO or ISREDIT , please someone could give me a light ? ;)

Thanks so much :D

PostPosted: Fri May 20, 2016 6:25 pm
by willy jensen
one solution:
run through the stem and QUEUE 'good' records, then do something like "EXECIO" queued() "DISKW ddname (FINIS)"

Re: I would like a rexx to remove a specific line from a fi

PostPosted: Sat May 21, 2016 2:13 am
by sngxd
Hello willy

Good your point but How I would queue good records ?

I mean I have an array c.1 c.2 c.3 then how I would pass my records into a queue ? I would perform a sub routine to save all records less the c.2 for example but how I would pass it into a queue ?

Re: I would like a rexx to remove a specific line from a fi

PostPosted: Sat May 21, 2016 2:56 am
by willy jensen
You really need to read the 'TSO/E REXX Reference' manual, where the QUEUE (and NEWSTACK and DELSTACK) TSO/E REXX commands are described. But I'll give you a quick sample based on your stem being c.:

address TSO
"delstack"
do n=1 to c.0
 if pos(specific-string,c.n)>0 then queue c.n
end
 

The 'pos' function is also described in the 'TSO/E REXX Reference' manual.