View previous topic :: View next topic |
Author |
Message |
Meg Beginner
Joined: 08 Jul 2003 Posts: 44 Topics: 16
|
Posted: Fri Feb 06, 2004 9:42 am Post subject: Inserting a line in a dataset after a string is found. |
|
|
Hi,
I want to insert 2 lines in 100s of members after I find a particuar string.
I want to do it through REXX. Can anyone let me know how to do this.
To eloborate more:
1. I have to search for the first occurence of a string.
2. Once this string if found, I need to know the line number.
3. After I get the line number, I will have to insert 2 lines after that line containing the string.
Thanks,
Megana |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Meg Beginner
Joined: 08 Jul 2003 Posts: 44 Topics: 16
|
Posted: Fri Feb 06, 2004 10:19 am Post subject: |
|
|
Hi Kolusu,
Thanx for redirecting me. But how do we find out the line number where the string is found?
Thanks,
Meg |
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Fri Feb 06, 2004 10:53 am Post subject: |
|
|
Meg,
You can use the following piece of edit macro to find out the line number of the first occurence of your search string -
Code: |
/***** REXX *****/
ADDRESS ISREDIT
"MACRO"
"FIND 'STR1' FIRST .ZF .ZL"
"(VAR1) = LINENUM .ZCSR"
SAY VAR1
EXIT
|
==> STR1 is your search string....
Regards,
Manas |
|
Back to top |
|
|
Meg Beginner
Joined: 08 Jul 2003 Posts: 44 Topics: 16
|
Posted: Fri Feb 06, 2004 10:55 am Post subject: |
|
|
Thanx a ton. This has reduced so much of my work. Thanx once again.
Megana |
|
Back to top |
|
|
superk Advanced
Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Fri Feb 06, 2004 11:10 am Post subject: |
|
|
Can one of the frequent posters and/or the site moderator help me out with something? I read these forums regularly, and I usually attempt to assist whenever I can. However, there always seems to be some underlying assumptions that I am not privvy to.
I would like to use this post as an example. Nowhere in the original message did the poster indicate that they wished to code an ISPF EDIT Macro (actually, they specified REXX). However, all of the soultions involved EDIT MACRO routines.
Is there an underlying presumtion that, if the item is posted in this forum, that the answer must be presented in terms of TSO, ISPF, or EDIT MACRO's, as opposed to straight CLIST/REXX? Are batch-related processes posted to the JCL forum instead?
It would help me to know how to post appropriate solutions. Thanks. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
|
Posted: Fri Feb 06, 2004 11:26 am Post subject: |
|
|
Superk,
Thanks for your participation on mvsforums. well if every poster is kind of enough to post detailed information on what they are trying to accomplish this question would not arise. Quite often a solution is posted with a guess and some basic assumptions. Sometimes 2 people can intrepret the same question differently and post 2 different solutions. We do not know which one is correct unless the poster comes back with a feed back. There are a very few posters(< 10%) who posts a feedback.
So feel free to post a solution and also you can point out the mistakes/flaws.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|