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
 

 

Changing the line , when a string is found

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri May 25, 2007 2:42 pm    Post subject: Changing the line , when a string is found
Reply with quote

Hi,

I have got a typical requirement.
When ever I find a string in statement ( say Job ) , i need to insert the string '//*' in the first column.
This is to be done with REXX.

Can anybody help me with this ??

Thanks,
ap_mainframes
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 May 25, 2007 2:53 pm    Post subject:
Reply with quote

Yes, an ISPF edit macro will do exactly what you want it to do.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri May 25, 2007 3:03 pm    Post subject: Re: Changing the line , when a string is found
Reply with quote

Can you please let me know which ??
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Sun May 27, 2007 12:10 am    Post subject:
Reply with quote

Here are the steps:
1. Start a FIND loop for the string in question.
2. Check the RC (RC=0 means the string was found).
3. If the string was found, get the line using LINE .ZCSR.
4. Use OVERLAY or INSERT to create the desired new line.
5. Use LINE again to override the old line.
6. Search for next occurence.

O.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Mon May 28, 2007 12:07 pm    Post subject: Re: Changing the line , when a string is found
Reply with quote

Hi,

I think i need to be more clear in my requirement.

Basically the requirement is to Comment the Job Card in a JCL with a REXX routine.

Now I thought that the approach would be to find the strings

' JOB ' in the line and comment it.
' MSGCLASS ' in the line and comment it then..

Can anybody explain it now??
Thanks for all the help provided.

Thanks,
ap_mainframes
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts Which function does the Ampersand (&a... Andi1982 PL/I & Assembler 3 Wed Aug 24, 2016 2:05 pm


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