Finding specific data

To find one or more occurrences of a character string in a data set or data set member, you can use the FIND primary command, which you can abbreviate as F or /.

For example, to search for the next occurrence of the string “James” in any mix of uppercase and lowercase, enter the following on the Command line:

F JAMES

To find the same string as you specified on the previous FIND primary command, specify an asterisk (*) as the search string.

To limit the search for a string to only where it appears as a prefix in the data, specify the PREFIX parameter.

To limit the search for a string to only where it appears as a suffix in the data, specify the SUFFIX parameter.

To limit the search for a string to only where it appears as a "word" in the data, specify the WORD parameter.

Note:
  1. To find long strings that do not fit on the Command line, use the FX command.
  2. To find and replace strings in multiple data sets or data set members, use the Find/Change Utility.
  3. To find and change a string or numeric value, open your data set in an Edit session, then use the CHANGE or CX primary command.
  4. By default, in SNGL or TABL display formats, if you enter the CHANGE, FIND, or EXCLUDE command without specifying any field references, File Manager searches all the visible fields based on the template attributes for each field. That is:
    • For a field with alphanumeric field attributes, the command performs a string comparison between the search string and the field being searched.
    • For a field with numeric field attributes, the command interprets the search string as a number, and performs a numeric comparison with the numeric value of the field being searched.
  5. If you want to prevent numeric comparisons from occurring, you can explicitly mark the argument as character by using the C'string' format. For example, this command finds only instances of alphanumeric fields containing the character "0":
    FIND c'0' ALL #3,#5

Related topics