MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Inserting a line in a dataset after a string is found.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Fri Feb 06, 2004 9:42 am    Post subject: Inserting a line in a dataset after a string is found. Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Fri Feb 06, 2004 9:56 am    Post subject: Reply with quote

Meg,

Please search before posting. Check this topic which discusses the similar requirement.

http://www.mvsforums.com/helpboards/viewtopic.php?t=898

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Fri Feb 06, 2004 10:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Fri Feb 06, 2004 10:53 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Fri Feb 06, 2004 10:55 am    Post subject: Reply with quote

Thanx a ton. This has reduced so much of my work. Thanx once again.
Megana
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Fri Feb 06, 2004 11:10 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Fri Feb 06, 2004 11:26 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group