z/OS ISPF Edit and Edit Macros
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


LOCATE—Locate a Line

z/OS ISPF Edit and Edit Macros
SC19-3621-00

The LOCATE macro command scrolls up or down to a specified line. The line is then displayed as the first line on the panel. There are two forms of LOCATE, specific and generic.

The specific form of LOCATE positions a particular line at the top of the panel. You must specify either a line number or a label.

The generic LOCATE command positions the panel to the first, last, next, or previous occurrence of a particular kind of line.

Syntax

Read syntax diagramSkip visual syntax diagram
Specific LOCATE macro command syntax

>>-ISREDIT--LOCATE--+-label---+--------------------------------><
                    '-linenum-'   

linenum
A relative line number identifying the data line.
label
A label identifying the data line. It must be a label that you have previously defined or an editor-defined label, such as .ZFIRST or .ZLAST.
Read syntax diagramSkip visual syntax diagram
Generic LOCATE macro command syntax

                    .-NEXT--.                 
>>-ISREDIT--LOCATE--+-------+--+-CHANGE---+--------------------->
                    +-FIRST-+  +-COMMAND--+   
                    +-LAST--+  +-ERROR----+   
                    '-PREV--'  +-EXCLUDED-+   
                               +-LABEL----+   
                               +-SPECIAL--+   
                               +-INFOLINE-+   
                               +-MSGLINE--+   
                               '-NOTELINE-'   

   .-.ZFIRST--.ZLAST-.   
>--+-----------------+-----------------------------------------><
   '-labela--labelb--'   

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 any 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 in which to search.
Note: If you try to locate a line using a label that has not been assigned, you will receive a return code of 20. To avoid this, use the LINENUM assignment statement. When using the LINENUM statement, a return code of 8 is issued if the label does not exist.
ISREDIT (X) = LINENUM .LABEL
linenum1
Relative line number identifying the start of a group of lines in which to search.
linenum2
Relative line number identifying the end of a group of lines in which to search.

Return codes

0
Normal completion
4
Line not located
8
Empty member or data set
20
Severe error

Examples

To locate the next occurrence of a line with a label:
ISREDIT LOCATE NEXT LABEL
To locate the first occurrence of a special (non-data) line:
ISREDIT LOCATE FIRST SPECIAL
To locate the last excluded line:
ISREDIT LOCATE LAST X
To locate the previous line that contains an unprocessed line command:
ISREDIT LOCATE PREV CMD
To locate the first message line:
ISREDIT LOCATE FIRST MSGLINE

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014