Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to rewrite a line using ISREDIT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: How to rewrite a line using ISREDIT
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: 8593
Location: Back in jolly old England

PostPosted: Fri Dec 23, 2011 12:36 pm    Post subject:
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: 1002
Location: Oostende, Belgium

PostPosted: Fri Dec 23, 2011 12:36 pm    Post subject:
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    Post subject: Reply to: How to rewrite a line using ISREDIT
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: 1002
Location: Oostende, Belgium

PostPosted: Fri Dec 23, 2011 6:28 pm    Post subject: Re: Reply to: How to rewrite a line using ISREDIT
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    Post subject: Add marker with CHANGE
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
This topic is locked: you cannot edit posts or make replies. Updating value of key using rewrite s... ParminderKumar COBOL Programming 4 Thu Aug 04, 2016 12:46 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us