LOCATE—Locate a Line

The LOCATE primary command allows you to scroll up or down to a specified line. The line then appears as the first line on the panel. There are two forms of LOCATE: specific and generic.

Syntax

Specific LOCATE syntax

Read syntax diagramSkip visual syntax diagramLOCATElabellinenum
The specific form of the LOCATE command positions a particular line at the top of the panel. You must specify either a line number or a label.
label
A previously assigned label.
linenum
An edit line number. If that line number exists, it appears at the top. If the line number does not exist, the line with the next lower number appears at the top of the data area.

The linenum operand is a numeric value of up to 8 digits. You do not need to type leading zeros. If the operand contains 6 or fewer digits, it refers to the number in the line command field to the left of each line. If linenum contains 7 or 8 digits, it refers to the sequence numbers in the data records. For NUMBER ON STD, the editor refers to the modification flag. For NUMBER OFF, it refers to the ordinal line number (first=1, fifth=5, and so on). For NUMBER ON COBOL, it refers to the number in the line command field, which is the data sequence number. See Sequence number format and modification level for more information.

Generic LOCATE syntax

Read syntax diagramSkip visual syntax diagramLOCATENEXTFIRSTLASTPREVCHANGECOMMANDERROREXCLUDEDLABELSPECIALINFOLINEMSGLINENOTELINE.ZFIRST.ZLASTlabelalabelb
The generic LOCATE command positions the panel to the first, last, next, or previous occurrence of a particular kind of line.
FIRST
Searches from the first line, proceeding forward.
LAST
Searches from the last line, proceeding backward.
NEXT
Searches from the first line of the page displayed, proceeding forward.
PREV
Searches from the first line of the page displayed, proceeding backward.
CHANGE
Searches for a line with a change flag (==CHG>).
COMMAND
Searches for a line with a pending line command.
ERROR
Searches for a line with an error flag (==ERR>).
EXCLUDED
Searches for an excluded line.
LABEL
Searches for a line with a label.
SPECIAL
Searches for a special non-data (temporary) line:
  • Bounds line flagged as =BNDS>
  • Column identification lines flagged as =COLS>
  • Information lines flagged as ======
  • Mask lines flagged as =MASK>
  • Message lines flagged as ==MSG>
  • Note lines flagged as =NOTE=
  • Profile lines flagged as =PROF>
  • Tabs line flagged as =TABS>
INFOLINE
Searches for information lines flagged with ======
MSGLINE
Searches for message lines flagged with ==MSG>
NOTELINE
Searches for note lines flagged with =NOTE=
labela, labelb
Labels identifying the start and end of the group of lines to be searched.

For more information about using labels to identify a group of lines, see Labels and line ranges.

Examples

To find the next special line, type:
LOCATE SPE
To find the first error line (==ERR>), type:
LOCATE ERR FIRST
To find the next line with a label, type:
LOC NEXT LABEL
To find the next excluded line between .START and .END, type:
LOC X .START .END
To find the first excluded line between .E and .S, type:
L FIRST .E .S X
To find the first message line, type:
LOCATE FIRST MSGLINE