Searching for data using the FIND primary command
The FIND (F) primary command searches for and displays, if found, data meeting specified conditions.
Displaying the FIND command screen
When you enter the FIND command without parameters, File-AID displays the FIND Command screen. Use the FIND Command screen to specify the search conditions.
FIND command with no parameters
Perform the following steps to display the FIND command screen:
- Type F in the COMMAND field.
- Press Enter. File-AID displays the FIND Command screen as illustrated in the following figure.
FIND Command Prompt Screen
Use the FIND Command screen to specify the search conditions.
FIND Command Prompt Screen
COMMAND ===>
Specify FIND operands:
Operator ===> (EQ; NE; LT; GT; LE; GE)
Find string ===>
Modifier ===> NEXT (NEXT; ALL; FIRST; LAST; PREV)
Lines to search ===> (NX = Nonexcluded; X = Excluded; Blank = all)
Specify the Following Fields to Limit the Range of Search for this FIND:
Field name ===>
or
Field number ===>
or
Start column ===> End column ===> (Column number(s))
Start range ===> End range ===> (Label or line number)
NOTE: You may bypass this screen by entering the FIND command with operands:
FIND string (NEXT) (NX) (col-1 (col-2)) (range)
F (op) string (ALL) (X) (/field name)
VALID (FIRST) (/field number)
INVALID (LAST)
* (PREV)
Specifying a FIND using the command prompt screen
FIND Command Prompt Screen - FIND JONES in EMP-LAST-NAME
The fields on the FIND Command screen correspond to the FIND primary command syntax parameters. For more information, see FIND command syntax. A sample of the FIND syntax is displayed on the bottom half of the screen.
Perform the following steps to specify a FIND using the command prompt screen:
Type EQ in the Operator field.
The relational operator EQ indicates that data must equal the value specified in the Find string field. Other valid operators are listed to the right of the field name. EQ is assumed when no operator is specified.
Type JONES in the Find string field.
The Find string field contains the value that you want to match defined by the value you specify in the Operator field.
Type NEXT in the Modifier field.
The value you specify in the Modifier field tells File-AID where to begin and in which direction to search. Using the NEXT value, File-AID searches forward in the data set starting at the current cursor position.
Type EMP-LAST-NAME in the Field name field.
Use the Field name field to limit the search to this field only in each record.
- Press Enter. File-AID searches the EMP-LAST-NAME field in each record to find the value JONES. When found, the screen is automatically scrolled to show the data found as illustrated in the following figure.
Result of FIND command
Browse - FIND Result - JONES found in Record 6
COMMAND ===> SCROLL ===> PAGE
RECORD: 6 EMPLOYEE-MASTER-FILE LENGTH: 198
---- FIELD NUMBER/NAME ------ -FORMAT- ----+----1----+----2----+----3----+----4
2 EMP-LAST-NAME 15/AN JONES
3 EMP-FIRST-NAME 10/AN GEORGE
4 EMP-MID-INIT 1/AN B
5 FILLER 2/AN
6 EMP-TITLE 30/AN COUNTRY SINGER
7 EMP-PERSONAL-INFO SYNC 23/GRP
8 EMP-NATL-ID-NUMBER 9/NUM 463813456
9 FILLER 1/AN
10 EMP-DATE-OF-BIRTH 6/AN 090944
15 EMP-HIRE-DATE 6/AN 920221
16 EMP-MARITAL-STATUS 1/AN S
17 EMP-PERSONAL-INFO SYNC 15/GRP
More about the FIND command
- In order for File-AID to search for exact case data, you must specify the Find value as a delimited string with a C (explicit character) data type. For example, ’Jones’ matches the values of Jones, jones, and JONES. However, C’Jones’ matches only the value of Jones.
The Find string parameter can be any one of the following data type strings:
String
Description
Simple
Value without quotes or data types specified. Matches both upper and lowercase values. The Find string, JONES in FIND Command Prompt Screen - FIND JONES in EMP-LAST-NAME is an example of a simple data type string.
Delimited
Specified with single quotes. The string can include imbedded spaces.
For example, 'delim ited' and T'delim ited' are equivalent.
Character
Expressed as C’string’ explicit case
Hexadecimal
Expressed as X’hex digits’.
Decimal
A number using digits 0—9. Used when a field-name/number is also specified.
Packed
Expressed as P’signed decimal number’.
VALID and INVALID
These validity keywords are used with a field-name/number to determine if the field contains valid or invalid data based on the layout definition of the field (a layout is required).
- For Unicode data, the FIND command has these restrictions:
- Only supports hex format.
- The parameters VALID and INVALID are not supported.
In FMT mode and VFMT HEX OFF mode, the cursor does not point to the exact position of the found string.
Related topics