View previous topic :: View next topic |
Author |
Message |
sumithar Beginner
Joined: 22 Sep 2006 Posts: 84 Topics: 29
|
Posted: Wed Mar 02, 2011 2:45 pm Post subject: Search for 2 strings |
|
|
How would I use search in ISPF (3.14/3.15) to find all dataset members that had both of two given strings in it, not necessarily on the same line.
So I want to find all source code members that have both the ADD and SUBTRACT verb in them, for example.
Thanks! |
|
Back to top |
|
|
prino Banned
Joined: 01 Feb 2007 Posts: 45 Topics: 5 Location: Oostende
|
Posted: Wed Mar 02, 2011 3:08 pm Post subject: |
|
|
You would probably need to do two searches with the 'LMTO' process option and use a SuperC compare on selected parts of the two output listings.
Just from the top of my head, not really any time to try this out. |
|
Back to top |
|
|
sumithar Beginner
Joined: 22 Sep 2006 Posts: 84 Topics: 29
|
Posted: Thu Mar 03, 2011 8:27 am Post subject: |
|
|
Thanks Prino. Someone gave me a solution using a Rexx script that trawls thru each member of the dataset and uses Edit macros to find the 2 strings.
I was hoping there was some Search option to do it more simply. |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Mar 03, 2011 1:49 pm Post subject: |
|
|
Extending the suggestion provided by prino, you can search both the strings together as shown in the code below and sort the OUTDD file for duplicate members.
Code: | //SEARCH EXEC PGM=ISRSUPC,
// PARM=(SRCHCMP,'LMTO,XREF,NOSUMS')
//NEWDD DD ...
//OUTDD DD ...
//SYSIN DD *
SRCHFOR 'ADD'
SRCHFOR 'SUBTRACT'
/ | * _________________ Regards,
Diba |
|
Back to top |
|
|
sumithar Beginner
Joined: 22 Sep 2006 Posts: 84 Topics: 29
|
Posted: Fri Mar 04, 2011 3:18 pm Post subject: |
|
|
Thanks- we use SYNCSORT so I need to use XSUM dataset to get what I actually want from the SORT step. |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Fri Mar 04, 2011 5:58 pm Post subject: |
|
|
Diba's post is not about the sort. It uses the SuperC compare utility.
I believe the posted SRCHFORs will be "or" rather than "and". If i'm able later, i'll connect and try a test. _________________ All the best,
di |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Mar 24, 2011 2:03 pm Post subject: |
|
|
papadi wrote: |
I believe the posted SRCHFORs will be "or" rather than "and". If i'm able later, i'll connect and try a test. |
papadi,
I thought you would provide with the your observation so didn't reply and forgot.
You are right, SuperC will provide the OR result.
But when you sort the result to get the duplicate member names, you get the AND result.
Note: If the dataset is sequential then you can get AND result from SUPERC. Not sure if you need to specify additional option. _________________ Regards,
Diba |
|
Back to top |
|
|
|
|