ISPF provides several ways to execute TSO commands without leaving the ISPF environment. Understanding how to invoke TSO commands from ISPF allows you to combine the convenience of ISPF's menu-driven interface with the power and flexibility of TSO command-line operations. This tutorial covers how to call TSO commands from ISPF panels, focusing on Option 6 (Command) and other methods for executing TSO commands within ISPF.
The ability to execute TSO commands from ISPF is valuable because it allows you to perform command-line operations without exiting ISPF, maintain your place in ISPF menus, and integrate command-line functionality with ISPF's visual interface. This integration makes mainframe work more efficient by combining the best of both interfaces.
ISPF Option 6: Command
ISPF Option 6 (Command) provides a dedicated interface for executing TSO commands while remaining within the ISPF environment. This is the primary method for running TSO commands from ISPF.
Accessing Option 6
To access Option 6:
From the ISPF Primary Option Menu, type 6 on the command line
Press Enter
ISPF displays the Command panel, which provides a TSO command interface
The Command panel typically displays a prompt (often "TSO" or "Command ===>") where you can enter TSO commands, similar to the TSO READY prompt.
Using Option 6
Once in Option 6, you can:
Enter TSO Commands: Type any TSO command at the prompt and press Enter to execute it
View Command Output: Command output is displayed on the screen, and you can scroll through it using function keys
Use Command History: Command history features (if available) work in Option 6, allowing you to recall previous commands
Execute Multiple Commands: You can execute multiple commands sequentially
Return to ISPF: Press PF3 (End) or type "END" to return to the ISPF Primary Option Menu
Option 6 Features
Option 6 provides several features that make it useful:
Integrated Interface: Command execution is integrated with ISPF, so you remain in the ISPF environment
Output Display: Command output is displayed within ISPF, with scrolling support for long output
Function Key Support: Standard ISPF function keys work in Option 6 (PF3 to end, PF7/PF8 to scroll, etc.)
Command History: Command history may be available, allowing you to recall and reuse previous commands
Easy Return: You can easily return to ISPF menus without losing your place
Executing Commands in Option 6
Executing TSO commands in Option 6 is straightforward and similar to using the TSO READY prompt.
Basic Command Execution
To execute a command in Option 6:
Type the TSO command at the prompt
Press Enter
View the command output on the screen
Use function keys to scroll through output if needed
Enter another command or return to ISPF
For example, to list catalog entries:
text
1
Command ===> LISTCAT
Press Enter, and the LISTCAT output is displayed.
Command Output Handling
Command output in Option 6 is displayed on the screen:
Immediate Display: Output appears immediately after command execution
Scrolling: Use PF7 (Up) and PF8 (Down) to scroll through output if it doesn't fit on one screen
Output Formatting: Output is formatted and displayed within the ISPF interface
Multiple Screens: For long output, you can scroll through multiple screens of results
Command Examples in Option 6
Here are examples of commands you might execute in Option 6:
All standard TSO commands work in Option 6 just as they do at the TSO READY prompt.
Other Methods for Executing TSO Commands from ISPF
In addition to Option 6, there are other ways to execute TSO commands from within ISPF.
Command Line on ISPF Panels
Many ISPF panels have a command line area where you can enter commands:
Command Area: Look for a command line at the bottom of ISPF panels, often labeled "Command ===>" or similar
Equal Sign Prefix: On many panels, you can type "=" followed by a TSO command to execute it
Direct Entry: Some panels allow direct TSO command entry in the command area
For example, on many ISPF panels, you can type:
text
1
Command ===> =LISTCAT
The "=" prefix tells ISPF to execute the following text as a TSO command.
Command Line Variations
The exact method for entering commands on panels varies:
Some panels require the "=" prefix
Other panels allow direct command entry without a prefix
Some panels may have specific command areas or fields for TSO commands
Panel-specific commands may take precedence, so TSO commands might need special syntax
Check the panel help (PF1) or documentation for specific instructions for each panel type.
When to Use Option 6 vs. Direct TSO
Understanding when to use Option 6 versus logging out of ISPF and using TSO directly helps you work more efficiently.
Use Option 6 When:
Option 6 is useful when:
You want to execute TSO commands without leaving ISPF
You need to maintain your place in ISPF menus
You want to combine ISPF operations with TSO commands in the same session
You need quick access to TSO commands while working in ISPF
You want to view command output within the ISPF interface
Use Direct TSO When:
Direct TSO (logging out of ISPF) may be better when:
You're doing extensive command-line work and don't need ISPF features
You're writing scripts or CLISTs that will be executed outside ISPF
You need the full TSO environment without ISPF overhead
You're performing operations that don't benefit from ISPF integration
Best Practices for Using TSO Commands in ISPF
Following best practices helps you use TSO commands effectively from ISPF:
Use Option 6 for Quick Commands: Use Option 6 when you need to execute a few TSO commands while working in ISPF
Return to ISPF Properly: Always use PF3 or END to return to ISPF rather than trying to navigate away
Scroll Through Output: Use PF7/PF8 to scroll through command output to see all results
Combine with ISPF Operations: Use TSO commands to complement ISPF operations, not replace them unnecessarily
Use Help: Use HELP command in Option 6 to get syntax help for TSO commands
Verify Commands: Verify command syntax before executing, especially for commands that modify data
Understand Context: Be aware that you're in ISPF, so some TSO operations may behave slightly differently than in pure TSO
Common Use Cases
Common scenarios where executing TSO commands from ISPF is useful:
Quick Dataset Operations: Using LISTCAT, LISTDS, or other dataset commands while working in ISPF
Allocation Management: Using ALLOCATE and FREE commands to manage dataset allocations
Profile Management: Using PROFILE command to check or modify TSO profile settings
Help and Documentation: Using HELP command to get information about TSO commands
System Information: Using system information commands to check status or configuration
Quick Utilities: Executing utility commands that don't have ISPF menu equivalents
Testing Commands: Testing TSO commands before including them in scripts or CLISTs
Limitations and Considerations
There are some limitations and considerations when using TSO commands from ISPF:
Output Formatting: Command output may be formatted differently in ISPF than in pure TSO
Screen Size: Output is constrained by ISPF screen size, so very long output requires scrolling
Interactive Commands: Some highly interactive TSO commands may not work as well in ISPF Option 6
Panel Context: You're still in ISPF context, so some operations may be affected by ISPF settings
Function Key Conflicts: Some function keys may have different meanings in ISPF than in pure TSO
For most standard TSO commands, these limitations are minor and don't significantly affect functionality.
Explain Like I'm 5: TSO Commands from ISPF
Imagine ISPF is like a big building with different rooms (menus), and TSO commands are like magic words you can say:
Option 6 is like a special room in the building where you can say magic words (TSO commands) and see what happens, but you're still in the building so you can easily go back to other rooms.
Regular ISPF is like using the building's buttons and menus to do things—it's easy but you can only do what the buttons let you do.
Option 6 lets you say any magic word you want, so you can do things that don't have buttons, but you're still in the building so you don't have to leave and come back.
Going back is like pressing a "return" button (PF3) that takes you back to the main room (Primary Option Menu) so you can go to other rooms or do other things.
So Option 6 is like having a special room in the ISPF building where you can use magic words (TSO commands) while still being in the building, so you don't have to leave and come back every time you want to say a magic word!
Practice Exercises
Complete these exercises to reinforce your understanding of executing TSO commands from ISPF:
Exercise 1: Option 6 Navigation
Practice accessing Option 6, executing several TSO commands (like LISTCAT, PROFILE LIST, HELP ALLOCATE), viewing the output, and returning to ISPF. Become comfortable with the Option 6 interface and navigation.
Exercise 2: Command Execution Practice
Execute various TSO commands in Option 6: dataset operations (LISTCAT, LISTDS), allocation commands (ALLOCATE, FREE), help commands (HELP), and profile commands (PROFILE). Practice scrolling through output and using function keys.
Exercise 3: Panel Command Line
Explore different ISPF panels and identify which ones have command lines. Practice entering TSO commands (with "=" prefix if needed) on various panels. Document which panels support command entry and how.
Exercise 4: Workflow Integration
Create a workflow that combines ISPF operations with TSO commands. For example, use ISPF to browse a dataset, then use Option 6 to run LISTDS on it, then return to ISPF to edit it. Practice switching between ISPF and TSO command execution.
Exercise 5: Comparison Exercise
Compare executing the same TSO commands in Option 6 versus at the TSO READY prompt. Note any differences in output formatting, behavior, or functionality. Document your findings about when each method is preferable.
Test Your Knowledge
1. Which ISPF option allows you to execute TSO commands?
Option 3
Option 5
Option 6
Option 7
2. How do you return to ISPF from Option 6?
Type EXIT
Press PF3
Type QUIT
Press PF12
3. Do TSO commands work the same in ISPF as at the TSO prompt?
No, they are different
Yes, they work identically
Only some commands work
Only in Option 6
4. What can you type on many ISPF panels to execute a TSO command?