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



IBM's Command List programming language & Restructured Extended Executor

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

Postby sngxd » Fri May 20, 2016 8:46 am

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
sngxd
 
Posts: 8
Joined: Fri May 20, 2016 8:39 am
Has thanked: 0 time
Been thanked: 0 time

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

 

Postby willy jensen » Fri May 20, 2016 6:25 pm

one solution:
run through the stem and QUEUE 'good' records, then do something like "EXECIO" queued() "DISKW ddname (FINIS)"
willy jensen
 
Posts: 69
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 14 times

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

Postby sngxd » Sat May 21, 2016 2:13 am

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 ?
sngxd
 
Posts: 8
Joined: Fri May 20, 2016 8:39 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby willy jensen » Sat May 21, 2016 2:56 am

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.
willy jensen
 
Posts: 69
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 14 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post