Pedro Luís
Pedro Luís

Reputation: 23

Search-For Utility Mainframe Algorithm

Can someone please give me some pointers on how the IBM mainframe Search-For Utility algorithm works?

How does it compare strings? What kind of matching algorithm does it use? How should I enter different strings in order to make the less comparisons possible?

I am using the utility but I do not know how it works, and I believe I am not using it as well as I should.

Thank you very much for your help!

Upvotes: 1

Views: 682

Answers (2)

Kenny
Kenny

Reputation: 316

You might consider IBM Developer for z, which which can do regular expression based searches. When the Remote Systems Explorer Daemon (RSED) is setup and running on the z/OS lpar, you can do searches across a single PDS or groups of PDS's using IDz filters. Very powerful. It also searches in the background so you can do other tasks while it searches. The searches can be saved for future ease of reference.

Upvotes: 0

SaggingRufus
SaggingRufus

Reputation: 1834

Think of it as a very dumb search.

It doesn't have the capacity to enter a REGEX or anything like that. I don't think anyone will be able to tell you what algorithm is used.

Search-For uses the SuperC program to actually perform the search. What it appears to do is search line by line for a match to the string you provided. So if I do a search for:

'PIC 9(9)'

I am going to get back results for every line that has that string in it. The only way I could bring back less search results, would be to add more to that string. So maybe search for:

'PIC 9(9).' 'PIC 9(9) VALUE 'PIC 9(9) COMP'

any of these 3 would provide less results than the first search. So if that string breaks a line like:

05 WS-SOME-VARIABLE PIC 9(9)
   VALUE 123456.

a search for 'PIC 9(9) VALUE' will not return anything, but a search for 'PIC 9(9)' would.

The more specific you are, the less search results you will get back. Depending on what you are looking for, you may be able to get better results by using Search-For in batch, or using File-Aid instead. Every specific scenario is different. So without knowing exactly what you are searching for and what your requirement it, its hard to tell you how to proceed.

Upvotes: 4

Related Questions