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


Starting point and direction of the search

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

To control the starting point and direction of the search, use one of these operands:
NEXT
Starts at the first position after the current cursor location and searches ahead to find the next occurrence of string1. NEXT is the default.
ALL
Starts at the top of the data and searches ahead to find all occurrences of string1. The long verification message, which PDF displays when you enter the HELP command in response to the short verification message, shows the number of occurrences found. If you use this operand with CHANGE, the lines changed are marked with ==CHG> flags, and lines that cannot be changed are marked with ==ERR> flags. The status of these lines can be used by LOCATE and changed by RESET.
FIRST
Starts at the top of the data and searches ahead to find the first occurrence of string1.
LAST
Starts at the bottom of the data and searches backward to find the last occurrence of string1.
PREV
Starts at the current cursor location and searches backward to find the previous occurrence of string1.

If you specify NEXT, ALL, or FIRST, the direction of the search is forward. When you press the assigned function keys, the RFIND or RCHANGE commands find or change the next occurrence of the designated string. If you specify LAST or PREV, the direction of the search is backward. When you specify those operands, the editor finds or changes the previous occurrence of the string.

The search proceeds until the editor finds one or all occurrences of string1, or the end of data.

If you omit the ALL operand on the CHANGE command, the editor searches only for the first occurrence of string1 after the current cursor location. If the cursor is not in the data area of the panel, the search starts at the beginning of the first line currently displayed. Scrolling is performed, if necessary, to bring the string into view.

After you make the change, the cursor is positioned at the end of the changed string; a verification message is displayed in the upper right corner of the panel.

Depending on the direction of the search, if the string is not found between the current cursor location and the end or beginning of data, a message is displayed and an audible alarm, if installed, is sounded.

If string1 is not found, one of these actions takes place:
  • A NO string1 FOUND message is displayed in the upper right-hand corner of the panel.
  • If CHANGE or EXCLUDE was repeated using RFIND or RCHANGE, either BOTTOM OF DATA REACHED or TOP OF DATA REACHED is displayed, depending on the direction of the search. When either of these messages is displayed, you can enter RFIND or RCHANGE again to continue the search by wrapping to the top or bottom of the data. If string1 is still not found, a NO string1 FOUND message is displayed.

When you type a primary command, the cursor is, of course, positioned on the command line. In the case of the CHANGE, EXCLUDE, and FIND primary commands, if you specify NEXT or PREV, the search starts at the current cursor location in a forward or backward direction respectively:

  • If you specify NEXT and then press Enter without repositioning the cursor, the current cursor position is taken to be at the top of the data. The search starts in a forward direction from that point.
  • If you specify PREV and then press Enter without repositioning the cursor, the current cursor position is taken to be at the bottom of the data. The search starts in a backward direction from that point.

To obtain the result you want, you may need to reposition the cursor after you have typed the primary command, but before you press Enter.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014