LOCATE (LOC, L)
The LOCATE command searches for and displays one of three types of information:
- Individual Line: Positions a specified individual record to the top of the data display.
- Line Type: Positions a specified type of record to the top of the data display.
- Field: Positions a specified field of the currently displayed record to the top of the data display.
The Individual Line syntax and the Line-Type syntax are available in the Browse and Edit functions in Character, Vertical Formatted, and Unformatted modes. The Field syntax is available in the Browse and Edit functions in Formatted mode.
Individual Line Syntax (Character, Vertical Formatted, and Unformatted Modes):
line-label
Searches for a specific line label. If the line label is found, File-AID positions that line at the top of the display. The remainder of the screen is filled, depending on the current display mode. Valid entries are a user-defined label and the File-AID-defined labels SEQ, DUP, ERR, and NEW. Entering an invalid line label produces the message: UNDEFINED LABEL.
line-number
Searches for a specific line number. If found, File-AID positions that line at the top of the display. Specify the line number without a preceding period. Valid line-number entries may be as large as eight digits. Leading zeros are not required.
Entering a number that is larger than the largest line number causes File-AID to position the last record at the top of the display.
Line-Type Syntax (Character, Vertical Formatted, and Unformatted Modes):
NEXT, PREV, FIRST, LAST
Specifies the starting point and direction of a line search. The following table summarizes the functions of these values.
LOCATE Line-Type Syntax Search Values
Parameter | Search Direction | Origin of Search |
---|---|---|
NEXT | Forward | Current cursor position |
PREV | Backward | Current cursor position |
FIRST | Forward | Start of data or specified line range |
LAST | Backward | End of data or specified line range |
line-type
Searches for a specific type of line. If found, positions the line at the top of the display. This parameter is required. Valid entries are listed in the following table. Not entering this parameter produces the message: INCOMPLETE LOCATE.
Valid LOCATE Line-Type Parameter Values
Value | Abbreviation | Definition |
---|---|---|
CHANGE | CHG | Line marked by the CHG or UNDO flag |
COMMAND | COM, CMD | Line with a pending line command |
DUPKEY | DUP | Line with duplicate key error marked by DUP flag |
ERROR | ERR | Line marked by ERR flag |
EXCLUDED | X | Line excluded from display with EXCLUDE primary command or X (exclude) line command |
LABEL | LAB | Line that had a user-defined label |
NEW | NEW | Line marked by NEW flag |
SEQERR | SEQ | Line with key sequence error marked by the SEQ flag |
SPECIAL | SPE | Information display marked by the BNDS, COLS, INFO MASK, MSG, OVLY, or PROF flag. |
lrange
Confines the search to a specified range of lines (records). For the line range limits, use any combination of user-defined labels, system labels, or valid line numbers, prefixed by a period.
Example 1
Places the next special information line at the top of the display:
Example 2
Places at the top of the display the first line in the data set that has been assigned a label:
Example 3
Places at the top of the display the next line marked by CHG or UNDO within the range from line 14 to line 20:
Example 4
Places at the top of the display the last excluded line within the range delimited by the user-defined labels .LAB1 and .LAB2:
Field Syntax (Formatted and Vertical Formatted Mode):
field-name, field-number
Searches for the specified field name or a field number. If found, File-AID positions the field to the top of the display. A slash (/) preceding the field-name or field-number parameter is optional.
The field name may be the fully qualified, partially qualified, or unqualified name of a data item. Any group or item designator in the field name may be abbreviated, starting with the first letter of each designator. If the abbreviated name is ambiguous (not distinct), the next field that matches the specified name is located.
Use the SHOW NUMBER primary command to see the field number assigned to a field.
If there are multiple instances of the data item, a subscript or set of subscripts can be listed at the end of the field-name or field-number parameter. If no subscript is listed, the next instance of the data item is located.
* (asterisk)
Used in place of the field-name or field-number parameter to reuse the field name or field number supplied from the previous LOCATE command. If a valid LOCATE command was not previously entered, an error message is displayed. If the asterisk parameter is used to repeat a field search, the search is continued in the direction specified in the previous LOCATE command.
Use the LOCATE * syntax to continue a search in the previously specified direction from the beginning of the record (if the BOTTOM OF RECORD message was displayed) or from the end of the record (if the TOP OF RECORD message was displayed).
NEXT, PREV, FIRST, LAST
Specifies the starting point and direction of a field search. The following table summarizes the functions of these parameters.
LOCATE Field Syntax Search Values
Parameter | Search Direction | Origin of Search |
---|---|---|
NEXT | Forward | Current cursor position |
PREV | Backward | Current cursor position |
FIRST | Forward | Start of data or specified line range |
LAST | Backward | End of data or specified line range |
Guidelines