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 

Search more than one string using an utility

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Tue Mar 08, 2005 10:28 am    Post subject: Search more than one string using an utility Reply with quote

Hi

I was using the following code in my REXX program to copy the uncommented lines of a COBOL program in to one temp dataset.

Code:
ADDRESS TSO
"FREE FI (SYSOUT SORTIN SORTOUT SYSIN)"
"ALLOC FI (SYSOUT) DA('"SYSOUT_DS"')  SHR REUSE"
"ALLOC FI (SORTIN) DA('"FROM_DS"') SHR REUSE"
"ALLOC FI (SORTOUT) DA('"TO_DS"') SHR REUSE"
"ALLOC FI (SYSIN) DA('"COPY_DS"') SHR REUSE"
ADDRESS LINKMVS ICEMAN


The COPY_DS will contain the follwoing code.

Code:
SORT FIELDS=COPY
OMIT FORMAT=SS,COND=(7,1,EQ,C'*')
END


My requirement is, I need to search for more than one string ( strings are desided dynamically from some other dataset) in that copied program. If any of the strings is found in the program then say RESULT - Y. Otherwise RESULT - N.

Presently I am using "F ALL " in an ISREDIT MACRO, called from my REXX program. Is there a way to search the strings simillar to the method I copied the program excluding comments.

Thanks in advance...
Sridhar P
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Mar 08, 2005 11:50 am    Post subject: Reply with quote

It's not clear what you're trying to do. Please show an example of your input records and what you want your output records to look like, and explain the example.

Note (perhaps this might actually answer your question):

Code:

  OMIT FORMAT=SS,COND=(7,1,EQ,C'*')


is a meaningless use of SS. SS is for substring searches. Since you're only looking for one character in a specific position, it would make more sense to use:

Code:

  OMIT FORMAT=CH,COND=(7,1,EQ,C'*').   


SS would be appropriate for something like this:

Code:

  OMIT FORMAT=SS,COND=(7,1,EQ,C'*.%$')


where you are looking for * or . or % or $ in position 7. Alternatively, you could specify that as:

Code:

  OMIT FORMAT=CH,
     COND=(7,1,EQ,C'*',OR,7,1,EQ,C'.',OR,7,1,EQ,C'%',OR,7,1,EQ,C'$')

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Wed Mar 09, 2005 7:49 am    Post subject: Reply with quote

Hi

Thanks for the reply. My requirement is some thing like this. I will be having four stings STRING_1, STRING_2, STRING_3, STRING_4 in member_1 of dataset_1. I just want to know whether any of these strings are present in member_1 of dataset_2 or not. Just one indicator "Y / N" is enough. This should be run from a REXX program.

Is it possible to do the same with ADDRESS LINKMVS ICEMAN.

Thanks
Sridhar P
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Mar 09, 2005 11:26 am    Post subject: Reply with quote

Still not clear. Please show an example of your input records in member_1 of dataset_1 and member_1 of dataset_2, and what you want your output to look like, and explain the example.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Fri Mar 11, 2005 11:05 am    Post subject: Reply with quote

Sridhar,

Why would you want to use SORT here? REXX can handle this all by itself. If you need REXX assistance, let me know.
________
K1100RS


Last edited by coolman on Sat Feb 05, 2011 1:40 am; edited 1 time in total
Back to top
View user's profile Send private message
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Tue Mar 15, 2005 4:58 am    Post subject: Reply with quote

Hi Coolman,

Currently I am using an ISREDIT macro which has a command "F ALL XXXX". I am running this macro on the dataset in which I need to search for a string. Since I am having more than 1 string, I am calling this macro in a loop by changing the value of XXXX. Here the tool becomes slow and consumes more time. Can you please suggest me an another method of doing the same.

Thanks in advance
Sridhar P
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Mar 15, 2005 8:47 am    Post subject: Reply with quote

psridhar,

Why not generate the control cards 3.15 in rexx and then submit the job from rexx it self?

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 -> Utilities 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