The FIND command in ISPF is used in Edit, View, and Browse modes to locate specific strings or patterns in datasets or members. It is a powerful tool that helps users efficiently navigate large datasets by pinpointing exact data within specified criteria.
Key Features -
Syntax -
FIND 'string' [range] [column-range] [options]
Search Modifiers -
Search Positioning -
Repeating a Search -
Use FIND *
to repeat the last search with the same string and direction.
Picture Clause Searches -
The Picture Clause allows finding patterns that match certain characteristics.
Strings are enclosed in single quotes and preceded by P
.
Picture Characters -
Character | Description |
---|---|
@ | Alphabetic characters. |
# | Numeric characters. |
< | Lowercase letters. |
> | Uppercase letters. |
$ | Special characters. |
. | Non-displayable characters. |
= | Any character, including blanks. |
- | Non-numeric characters. |
~ | Non-blank characters. |
For example, FIND P'NAME#' ALL
locates all occurrences of strings like NAME0, NAME1, ... NAME9.
Examples -
Scenario - Find all occurrences of "HELLO" in the program.
If the text found, all the occurrences of text highlighted in white and cursor will be placed at the first occurrence of the text.
Press PF5 key to find the next occurrence.
More Examples -
Command | Function |
---|---|
FIND 'ABC' |
Locates the first occurrence of the string ABC . |
FIND 'XYZ' 10 20 |
Searches for XYZ in columns 10 to 20. |
FIND 'DATA' 5 15 |
Finds the string DATA between lines 5 and 15. |
FIND 'ERROR' .A .B |
Locates the string ERROR between labels .A and .B . |
FIND 'USER' ALL |
Highlights all occurrences of USER and displays their count. |
FIND WORD'VALUE' |
Finds VALUE as a complete word, ignoring substrings. |
FIND PREFIX'123' |
Locates strings starting with 123 . |
FIND SUFFIX'END' |
Finds strings ending with END . |
FIND * |
Repeats the last executed FIND command. |
FIND 'string' .A .B 30 45 |
Searches for "string" between labels .A and .B and within columns 30 to 45. |
FIND P'NAME#' ALL |
Finds all occurrences of NAME0, NAME1, ..., NAME9. |
Default Behavior of FIND -