1

Is there a command to scroll to the top of of the file in ISPF? Also, scroll to bottom?

Similar to lower case g in VI.

Also, is there anything like scroll to top of function or scroll to opening bracket?

Thanks

GC_
  • 383
  • 1
  • 19

2 Answers2

3

Type m on the command line and press PF8 to go to the bottom of the file and PF7 to go to the top of the file.

While ISPF editor has its advantages, it does not have the features found in vi. If you are more familiar with vi, you can try using UNIX System Services where vi is available. There are also ports of vim that run in UNIX System Services.

Once in UNIX System Services shell session, you can use cp command to copy a text file from a data set to a UNIX file, edit it and then use the cp command to copy it back to the data set.

Milos Lalovic
  • 476
  • 1
  • 6
  • 1
    Editing a file in the manner you describe introduces the (perhaps acceptable) risk that someone else will modify the file whilst you are editing in vi, and your cp from the USS file back to the dataset will overlay their changes. While in ISPF Edit, an ENQ is issued for the dataset, or PDS(E) member, preventing others from making changes. – cschneid Aug 14 '20 at 17:42
  • I liked running Oedit from the USS. "Oedit ." was a good command, too. – GC_ Aug 18 '20 at 14:40
  • I've dabbled in Vi, and much prefer the ISPF editor. Not being argumentative when I ask what features does vi have that ISPF lacks? – Steve Ives Aug 19 '20 at 08:18
  • 1
    Just to clarify, when you type 'm' on the command line and press PF7 (to go toe the top) or PF8 (to go tot eh bottom what's actually happening is that the editor is receiving the common assigned to the PF key ('UP' or 'DOWN' for PF7 and PF8 respectively) suffixed with what you typed on the common line ('m' which is short for 'max'). So 'n' PF7 sends the command 'UP M'. – Steve Ives Aug 19 '20 at 08:21
3

You have a few options. top and bottom allows for navigation to the first line and last line. These are aliases for the commands up max and down max respectively. For completeness, up xxx and down xxx moves the screen up or down xxx lines.

Also you can enter m in the command line and hit up or down pf keys (Pf7 or pf8). You can enter a number on the command line (say 50) and hit Pf7* or pf8 to go up/down 50 lines

Bruce Martin
  • 9,845
  • 1
  • 24
  • 36
meat
  • 589
  • 2
  • 8
  • Technically, you answer covers, more options. However, m f7 was what I used to do. And he was first. – GC_ Aug 18 '20 at 14:38
  • That's fine. I learned something new from that answer anyway since I always used top and bottom myself. – meat Aug 19 '20 at 19:39