Strovent SystemsSign in
Reference

Search all members of a data set in ISPF, SRCHFOR and SFE

How to find a string in every member of a PDS from the ISPF data set list or option 3.14 and 3.15, with word, hex and case options.

To find which members of a library contain a word, you do not have to open each member. ISPF can search the whole data set.

From the data set list (option 3.4)

Open the data set list (ISPF option 3.4), then use one of these:

  • SF line command, typed next to a data set, runs the Search-For Utility on it. For a PDS or PDSE it uses the member list. SF string1 gives one search string. With no string, a Srchfor Options pop-up opens, where you can enter several strings, process options and output options.
  • SFE line command does the same with the Extended Search-For Utility, option 3.15.
  • SRCHFOR string typed on the command line searches all the data sets in the list. The string is optional and always converted to uppercase. If you give one, it fills in the first search string of the Srchfor Options panel.

IBM's manual says you can enter E, V or B straight after SF, for example SF B, to set whether the S line command in the member list edits, views or browses a member. The output option Filter list lists only the members that contain one of the strings.

Press Enter on the Srchfor Options panel to start the search. To cancel, enter END or CANCEL.

Search strings

These rules are from the SRCHFOR command description:

  • The search is case sensitive and must match exactly as written. Select the Any case process option to ignore case.
  • The operands WORD, PREFIX and SUFFIX limit a match to a whole word, or to the start or end of a word.
  • A C (continuation) operand means the current and the previous string must both be on the same line. Without it, a line with either string is a match.
  • A hexadecimal string is written X'7B00'.
  • A string with an apostrophe uses a doubled apostrophe: 'AB C''D' searches for AB C'D.
  • ABC and EFG on two lines: Either string may be found.
  • ABC WORD and EFG C: Both must be on the same line. ABC must be a complete word.
  • ABcD prefix: Found only if the case matches and it is the prefix of a word.

A hex search listing must be browsed with HEX ON.

Option 3.14 and 3.15

Option 3.14 is the Search-For Utility and 3.15 is the Extended Search-For (Search-ForE) Utility, both from the Utilities menu. On the 3.15 panel:

  • Search DS Name is a sequential data set, a PDS or a membered PDS. Use TSO naming, with quotes for a fully qualified name. Leave it blank to get a panel for concatenated or uncataloged data sets.
  • PDS Member List: blank shows a list of all members. A pattern such as ISR* shows the matching members. * searches all of them.
  • CAPS is a search string converted to uppercase and found only if it exists in uppercase, unless the ANYC process option is used. There are three CAPS fields.
  • ASIS is searched for exactly as you type it.
  • Listing DSN is where the listing is written. If it is blank, the name is prefix.userid.SRCHFOR.LIST.
  • The Bypass Selection List option processes all members matching a pattern without showing the member list.

Where the results are

The listing goes to the listing data set you named. From the data set list, the results are also in the MESSAGE field of the DSLIST. Sort on that field to bring the matches together.

Sources

Spotted a mistake? Email [email protected].