IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to rewrite a line using ISREDIT


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Chaketh Ram

New User


Joined: 16 Nov 2011
Posts: 7
Location: India

PostPosted: Fri Dec 23, 2011 11:59 am
Reply with quote

I have a requirement to find a particular string in a file and if a match is found,then an indicator has to be appended to that line.

I have coded upto searching for the string and creating an updated string with the added indicator.


Code:

address isredit
"macro noprocess"
"isredit reset"
"isredit cursor = 1  1"
"isredit find next abcdef 13"     /*srching for test string abcdef*/
if rc < 4 then
do
"isredit (lnc) = linenum .zcsr"
"isredit (cline) = line .zcsr"
job = substr(cline,1,12)
cline = left(job,12)||Y


One way to get the updated line would be to delete the old line and insert the new line.

Is there a way to directly update the existing line with the indicator.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Dec 23, 2011 12:36 pm
Reply with quote

I think that is what you may need to do
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Dec 23, 2011 12:36 pm
Reply with quote

A whoopie, a yes/no question: YES
Back to top
View user's profile Send private message
Chaketh Ram

New User


Joined: 16 Nov 2011
Posts: 7
Location: India

PostPosted: Fri Dec 23, 2011 12:48 pm
Reply with quote

Figured out a way to do it.

Keyword MASKLINE is used for this.

Code:

address isredit
"macro noprocess"
"isredit reset"
"isredit cursor = 1  1"
"isredit find next abcdef 13"  /* search string abcdef*/
if rc < 4 then
do
"isredit (lnc) = linenum .zcsr"
"isredit (cline) = line .zcsr"
job = substr(cline,1,12)
cline = left(job,12)||Y
/*say cline*/
"isredit line" lnc "= maskline +(cline)"


Please let know if there is a better way to do it

Thanks
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Dec 23, 2011 6:28 pm
Reply with quote

Chaketh Ram wrote:
Figured out a way to do it.

Keyword MASKLINE is used for this."

No, it isn't, but someday, after screwing up badly, you will find out why.
Back to top
View user's profile Send private message
Michael Jakob

New User


Joined: 13 Mar 2011
Posts: 17
Location: Switzerland

PostPosted: Fri Jan 06, 2012 3:58 am
Reply with quote

If you like you can change your line with:

In this case your marker will be placed at first empty place.

ADDRESS "ISREDIT" "CHANGE ' ' '"cline" .zcsr .zcsr"

With

ADDRESS "ISREDIT" "LINE .ZCSR = (cline)"

you fill you replace the line in the file with cline.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts rewrite same SAY line CLIST & REXX 8
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
No new posts Repeat a DD line- comment and insert ... CA Products 3
Search our Forums:

Back to Top