One of the most powerful features of the Interactive System Productivity Facility (ISPF) is its extensibility. While the standard menus and commands cover a vast array of mainframe tasks, every shop has unique needs. ISPF Command Tables are the mechanism that allows system programmers and developers to define custom commands, modify existing ones, and integrate third-party tools seamlessly into the ISPF environment.
In this comprehensive guide, we will explore how ISPF Command Tables work, how to use the Command Table Utility (Option 3.9), and how to leverage these tables to integrate external tools like file managers, debuggers, and change management systems.
At its core, an ISPF Command Table is a lookup database. When you type a command on the Command line (e.g., SAVE, CANCEL, or SWAP) and press Enter, ISPF doesn't inherently know what that text means. It consults a series of Command Tables to find a match.
Each entry in a command table defines:
ISPF searches command tables in a specific order to resolve commands. Understanding this hierarchy is crucial for customization and troubleshooting.
ISPCMDS table, but specific editor commands might be handled internally or via edit macros. However, custom applications often have their own tables (e.g., XYZCMDS).SPLIT, SWAP, HELP, and EXIT. It is active for all users.ISPF provides a built-in utility for managing command tables. This is Option 3.9 (Utilities > Command Tables).
Navigate to Option 3.9 from the Primary Option Menu. You will be presented with a list of currently active command tables or a prompt to enter a table name.
123456789101112Menu Utilities Compilers Options Status Help ------------------------------------------------------------------------------ ISPF Command Table Utility Option ===> A Application - Process the application command table U User - Process the user command table S Site - Process the site command table T Table - Process a specific table (enter name below) Table Name . . . . ________ (for option T)
When you edit a command table, you see a tabular list of commands. Each row represents one command. Here are the key columns you will define:
This is the name of the command as the user will type it. It must be unique within the table. Examples: MYTOOL, XLATE, ZIP.
This integer specifies the minimum number of characters the user must type for ISPF to recognize the command.
Example: If Verb is UPDATE and T is 2, the user can type UP, UPD, UPDA, etc., and they will all match UPDATE. If they type U, it will not match.
The action determines what happens when the command is matched. The most common actions are:
Depending on the Action, this field holds different data. For SELECT, it contains the selection string (e.g., CMD(MYREXX)). For ALIAS, it contains the target command.
Integrating third-party tools (like Debuggers, File Managers, or SCM tools) into ISPF essentially involves creating "hooks" in the command tables. This allows users to invoke these complex tools with a simple command from any ISPF screen.
Imagine you have a REXX script named QUICKJOB that submits a standard job for the user. You want users to be able to type QJ from any command line to run it.
QUICKJOB2 (So QJ works)SELECTCMD(QUICKJOB)Now, whenever you type QJ or QUICKJOB on an ISPF command line, ISPF will execute the QUICKJOB REXX script found in your SYSPROC/SYSEXEC concatenation.
You often need to pass arguments to your tool. The SELECT action handles this seamlessly.
12345Verb: FINDUSER Trunc: 4 Action: SELECT Description: CMD(SEARCHU &ZPARM)
In this example, &ZPARM is a system variable that contains everything the user typed after the command verb. If the user types FINDUSER STEVES, the REXX script SEARCHU is called with the argument STEVES.
Many vendor tools use this exact mechanism.
NDVR which points to a SELECT CMD(ENDEVOR) or similar driver.FM or FMN to invoke the File Manager main menu.SAVE or END) unless you specifically intend to override them.Imagine you are in a magic castle (ISPF). You can ask the castle to do things by shouting magic words (Commands).
However, the castle doesn't understand every word in the world. It has a big "Book of Spells" (The Command Table).
Option 3.9 is like a special pen that lets you write new spells in the book. You can write: "When I say 'SNACK', bring me a cookie." Now, whenever you say SNACK, the castle (ISPF) checks the book, sees your new rule, and brings you a cookie (runs your program).
Try these exercises to master Command Tables. (Note: You may need access to a sandbox environment or your own user table).
SWAP command. What is its truncation value?HELLO that invokes a simple REXX script that says "Hello World".BYE an alias for the standard command EXIT.1. Which ISPF utility option is used to manage Command Tables?
2. What is the name of the default system command table?
3. Which Action field value indicates that the command should invoke a CLIST or REXX exec?
4. What does the "Trunc" field specify in a command table entry?
5. If you want multiple command names to perform the exact same action, which Action type should you use?