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

Changing the line , when a string is found


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Fri May 25, 2007 2:53 pm
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
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: 2358
Location: Israel

PostPosted: Sun May 27, 2007 12:10 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top