FIND (F)
Using FIND During a Browse or Edit Session
The FIND command positions the cursor at the first occurrence of the specified value. It can be issued during a browse or edit session.
Use the column-name parameter with the FIND command to request that only data in the specified column is found. You may further restrict the data search by specifying positions within the column. If no column name is entered, all columns in the table are searched. However, the FIND command searches only certain column types based on the type of the find-string parameter. The chart in Columns Searched by Data Type describes which columns are searched.
By default, the FIND command searches both excluded and non-excluded lines as well as both hidden and non-hidden columns. You can limit the search to only excluded rows and hidden columns or only non-excluded rows and non-hidden columns.
Find String
Value to be found. The first parameter for the FIND command is always the find-string. The find-string value is not case sensitive, unless enclosed in quotes and prefaced by C. Enclose the string in either single or double quotes when
- The find-string contains blanks
- The find-string matches the characters of reserved words, for example NULL, but you only want to change words with these characters in them. Valid reserved words for the FIND command are:
ANY (only in find string) | CURRENT_TIME |
CUR | CURRENT TIMESTAMP |
CURR | CURRENT_TIMESTAMP |
CURRENT | USER |
CURRENT DATE | NULL |
CURRENT_DATE | NULLS |
CURRENT TIME |
- The find-string contains a single quote (’), you must enclose it in double quotes.
- The find-string contains double quotes ("), you must enclose it in single quotes.
ANY
Finds any value in a column without any regard to its current value. Specify ANY as the 'find-string' but don’t enclose it in single or double quotes. You must also specify a column name when using the reserved word ANY.
If ANY is too general as a wildcard you may want to substitute picture strings for ANY as the find-string.
P
Specifies a picture string. P’picture’ may contain one or a combination of the following:
= | any character |
¬ | any non-blank character |
. | any undisplayable character |
# | any numeric character |
- | any non-numeric character |
@ | any alphabetic character |
< | any lowercase alphabetic character |
> | any uppercase alphabetic character |
$ | any special character |
X
Specifies that the value is in hexadecimal format. When specifying a hexadecimal value, you must enclose the find string in single or double quotes.
NULL
Specify to search for null values.
column-name
Name of the Db2 column to be searched for the specified value. If you do not specify a column name, the find is applied to all columns. You can specify a partial column name. If more than one column name matches the criteria, a window displays all matching columns, allowing you to select one. See Column Selection window for a sample column selection window.
Start position
Starting position within a specified column name in which you want to restrict the search. If only one position is specified, it is processed as a starting position.
End position
Ending position within a specified column name in which you want to restrict the search. If only one position is specified, it is processed as a starting position.
Modifiers
Specify one of the following parameters to modify the search order.
NEXT
Default. Starts a search for the next occurrence of the find-string at the beginning of the first line being displayed (if the cursor is still on the COMMAND line), or at the cursor location (if the cursor is in the data part of the display). If you specify both a column name and the NEXT parameter, the next occurrence in the specified column of the find-string is found.
ALL
Finds all occurrences of the find-string starting at the beginning of the first line of the data and continues to the bottom of data. If you specify both a column name and the ALL parameter, all occurrences in the specified column of the find-string are found.
PREV
Starts a search for the previous occurrence of the find-string starting at the end of the line preceding the first line being displayed (if the cursor is still on the COMMAND line), or at the cursor location (if the cursor is in the data display). If you specify both a column name and the PREV parameter, the previous occurrence in the specified column of the find-string is found.
FIRST
Starts a search for the first occurrence of the find-string starting at the beginning of the first line of the data and continues until the string is found or the bottom of data is reached. If you specify both a column name and the FIRST parameter, the first occurrence in the specified column of the find-string is found.
LAST
Starts a search for the last occurrence of the find-string starting at the end of the last line of the data and continues backward until the string is found, or the top of data is reached. If you specify both a column name and the LAST parameter, the last occurrence in the specified column of the find-string is found.
Rows/Columns to Search:
Specify one of the following parameters to determine which rows or columns to search.
Blank
Default. Searches for the string in all rows and columns.
NX
Searches for the string only in those rows that are not excluded and columns that are not hidden.
X
Searches for the string only in those rows that are excluded and columns that are hidden.
FIND Command Window
The FIND command window (see the following figure) prompts you for the information required to complete the find. It displays when you enter FIND with no parameters. Press Enter on this screen to process the find and exit the window. Press END to cancel the FIND command and exit the window.
FIND Command Window
Find string
Value to be found. To specify a hexadecimal value, enclose the string in single or double quotes and preface it with an X. To specify a null value, enter NULL. To specify a case sensitive string, enclose the string in quotes and preface it with a C.
Column-name
Name of the Db2 column in which you want to restrict the search. Entering an asterisk (*) presents a list of columns from which you can select a column name. You can also enter partial column names. If more than one column name matches the criteria, a window displays all matching columns, allowing you to select one. See Column Selection window for a sample window. If you do not specify a column name, the search is applied to all columns.
Start position
Starting position within the specified column name in which you want to restrict the search. If no end position is specified, the search continues until the end of the column.
End position
Ending position within the specified column name in which you want to restrict the search. If no start position is specified, the search begins at the beginning of the column.
Modifier
See Modifiers for an explanation of valid values.
Rows/Columns to search
See Rows/Columns to Search: for an explanation of valid values.
Using FIND in Relationship Object Lists
FIND command in relationship object lists:
The FIND command searches through data in the display and positions the line with the next occurrence of the specified find-string to the first line of the displayed data. It can be issued whenever File-AID for Db2 displays a list in the relationships option.
FIND Parameter Window
When you enter the FIND command without any find-string, the Find Parameter window (see the following figure) displays. Enter the find-string and modifier.
Enter Find Parameter window