Leaving OMVS, the z/OS UNIX shell, from a 3270 session
Why PF3 does not exit OMVS, how to leave with exit or QUIT, what the default PF keys do, and how to get out of a stuck command.
OMVS is the TSO/E command that starts the z/OS UNIX shell in a 3270 session. Its function keys are not the ISPF ones. In OMVS, PF3 means Return, not End or Exit, so pressing it does not leave the shell.
Leave the shell normally
Type this at the shell command line and press Enter:
exit
If you started the shell from ISPF, you return to ISPF. If you started it from the TSO READY prompt, you return to READY.
You can also type the OMVS escape character followed by d (the shell's end-of-file). That sequence does not work if you set the shell option ignoreeof (set -o ignoreeof), but exit still does.
Leave while something is running in the background
Press the Subcommand key (PF2 by default) to enter subcommand mode, then type:
QUIT
QUIT ends the session you are looking at and switches to another one. It returns to TSO/E if it was the only session. QUITALL ends every shell session and OMVS itself, and returns to TSO/E.
By default a background job started from the shell runs in its own process group and keeps running after you leave. If you set set +m (or set +o monitor), IBM says to use nohup for anything that should keep running after you log out.
If a command is stuck in a loop
First try to interrupt the program with Ctrl-C. A 3270 keyboard has no Ctrl key, so type the OMVS escape character and then c. The escape character depends on the character conversion table in use, and the PFSHOW subcommand shows it at the bottom of the screen. If that fails, press the Subcommand key, type quit and press Enter. This ends OMVS abruptly and returns you to TSO/E, and the shell stops processing.
Leave temporarily
Press the TSO key (PF6 by default) with the command line blank. This suspends the shell and puts you in TSO/E command mode, where you can enter TSO/E commands. Press Enter or the Return key to go back. Shell commands keep running until they try to read from the terminal or the output buffer is full, and then they wait until you return.
To run one TSO/E command without suspending the session, type it on the command line and press the TSO key.
Default OMVS function keys
- PF1: Help
- PF2: Subcommand mode
- PF3: Return (back to the shell from help or subcommand mode)
- PF4: Top
- PF5: Bottom
- PF6: TSO
- PF7: Scroll back one screen
- PF8: Scroll forward
- PF9: Next session
- PF10: Refresh
- PF11: Retrieve the oldest saved input line
- PF12: Retrieve the most recent input line
PF13 to PF24 repeat PF1 to PF12. Keys can be changed when OMVS starts, for example OMVS PF1(NEXTSESS). To show the current settings at the bottom of the screen, use the PFSHOW subcommand.