Mainframers are aware that the Interactive System Productivity Facility (ISPF) editor, introduced in the 1970s, is easy to learn and helps with basic editing. The editor also has many powerful functions that enable users to manipulate source code and edit and analyze data, noted Dan Dirkse, president of Iuvo Technologies, Inc., at SHARE Fort Worth during his SHARE Best Session "ISPF Master Class: Edit - from A to .ZLAST." He added that there have been a number of additions to edit/view over the years that may have been missed.
"We often think we are too busy to invest time in ourselves," said Dirkse. "Learning how to use our tools increases our personal productivity and the quality of our work, and is more than worth the effort expended. As the session name implies, ‘Edit – from A to .ZLAST,’ I touched on every primary and line command, highlighting those that greatly improve my productivity. Additionally, I introduced the Edit service and Edit macros."
How Edit Service and Edit Macros Help Users
Dan shared that he doesn't use the Edit or View Entry panels frequently, but he has written simple Rexx execs that call the Edit or View services to access his commonly used data sets. "For example," he said, "to edit the JC member of my JCL library, I type TSO EJ JC on any command line. The EDIT service can be used to edit individual data sets or concatenations of up to 16 related data sets. Any additions or changes will be stored in the first data set in the concatenation." Dirkse added that the EDIT and VIEW services are only two of over 30 library management services available in ISPF. This is in addition to the many Dialog Management services available. The Edit MODEL primary command can be used to copy examples of each service for many different supported languages.
The System Display and Search Facility (SDSF) uses the Browse and Edit Interface (BRIF/EDIF) services for its SB, SE, and SJ line commands to browse output, edit output, and edit the submitted JCL. Dirkse said that these commands give you all the functions of browse and edit/view for working with this data.
Edit macros in their simplest form can be used to do a series of commands in a single step. "By using the 100 macro functions available," Dan explained, "you can create virtually anything you can imagine and create new primary commands. In fact, CUT and PASTE originally were edit macros I wrote that were eventually added to the base product." He added that "using the Edit service, which has an option for an initial macro, you can write sophisticated ISPF dialogs that use the editor to initialize data for the user, as well as require data to be valid before allowing it to be saved." Edit macros can be used to run the editor in batch and for mass changes to a selection of members of a PDS.
In addition to new primary commands, edit macros can now be used to create new line commands, according to Dirkse. The Edit Entry panel and the Edit service now have a Line Command Table option. The Line Command Table can be edited using option 3.16 (ISPF Table Utility) to define the relationships between the line commands and the names of the edit macros used to perform the functions, he said.
Tips for Maximizing Productivity
Because ISPF now supports up to 32 split screens (8 by default), Dan recommended taking advantage by defining F2 as the START command instead of SPLIT NEW to open a new full screen, F9 as SWAP NEXT to swap to the next screen in a round-robin fashion, F14 as SPLIT when you wish to see data from multiple screens, and F21 as SWAP LIST to display a list of your open screens. The SWAPBAR command, he pointed out, can also be used to display point-and-shoot fields to go directly to another screen using your mouse. Setting up a ZSTART profile variable with a value of ISPF;2;START 3.4;START 6;START 3.13;SWAP 2, for example, will, upon ISPF start up, open the Edit Entry Panel, the Data Set List Utility, the Command Shell, an Extended SuperC Utility panel, and then swap back to the Data Set List Utility.
"If you aren't using CRETRIEV for F12, you should. It merges the functionality of the original CURSOR with RETRIEVE – bringing you to the command line if you aren't there and performing a retrieve from the command stack once you are," explained Dirkse. "RETP (Retrieve Panel) can be defined to F24 to display the command stack and scroll to prior commands for selection by number or via your mouse. The options pulldown from the RETP panel lets you set the minimum command size to be stacked, as well as the position of your cursor after a retrieve."
In terms of the mouse, Dan said, "Your emulator may support defining your right mouse button to F3, and your scroll wheel to F7 and F8. Along with point-and-shoot fields, this enables faster navigation." Meanwhile, he explained that unused PF keys can be defined to perform a series of primary commands using your stacking character (semi-colon by default), an edit macro, or, by using a colon as a prefix, edit line commands. "For example, instead of entering TS as a line command and moving your cursor to the split point, define a PF key as :TS. To split a line, position your cursor at the split point and press the PF key," Dirkse said.
Explore Newer Line and Primary Commands
Find/Change/Exclude now support regular expressions for the search string. Dirkse shared that regular expressions have a steeper learning curve than Picture strings, but they have much broader capabilities. Additionally, edit/view now support ASCII and UTF-8 character sets.
"You can now turn on Hex mode (vertical format only) for a line or group of lines instead of the whole data set," he said. "Use the HX (HXX block format) line command to toggle hex mode (HEX OFF to remove all hex mode lines)."
The After/Before/Overlay line commands, used in conjunction with COPY and MOVE, can now be suffixed with a K (as in, keep going), according to Dan. To copy a source line or block of lines to multiple targets, use AK or BK to indicate each target with the last target indicated with only A or B.
"When working with excluded lines," he explained, "the HIDE X primary command removes the - - - 1 Line(s) not Displayed lines from the display so you can easily select data with your mouse for pasting into a PC file. The excluded lines are indicated by underscores under the sequence numbers." RESET HIDE (RES H) can be used to restore the normal format, and the FLIP primary command can be used to change all non-excluded lines to be excluded, and vice versa.
Dan pointed out, "The COLS primary command (versus line command) will set a columns line at the top of your data. It will remain on top while you scroll through your data. Use COLS OFF to remove it."
The COMPARE (COMP) primary command brings the power of SuperC into edit/view. "You can use it to compare what you are editing to another data set, member, or Z/OS UNIX file," said Dirkse. "Lines that only exist in the source being edited are indicated with line labels (e.g., .OAAAA) and lines that only exist in the other data source are indicated by information lines (i.e., ======). The X option excludes the matched lines." The COMP command without options displays the Compare Settings panel, which can be used to control the number of 'context' lines and set many other options. "Used in conjunction with the MD (Make Data) line command," he added, "it is easy to merge changes by converting the information lines into data lines."
Dan said, "COMP * deserves special praise." The asterisk (*) indicates the comparison should be done between the current, in-memory copy of the data and what exists on disk. It quickly shows the changes that have been made. "Using the MD line command," he said, "you can perform a selective undo of lines that were changed or deleted earlier in your edit session, unlike the standard UNDO command that reverses your most recent changes."
The CUT primary command now supports multiple clipboards. Use CUT ABC to store data into the ABC clipboard. The CUT DISPLAY (DIS) command displays the Clipboard Manager panel. The EDSET primary command displays options for CUT and PASTE, as well as other edit settings.
The HILITE (HI) primary command controls language sensitive coloring of many programming languages, SuperC Compare output, and XML. Dirkse noted, "Entering HI displays the Edit Color Settings panel, which, in addition to selecting the language, can indicate what logic to color and whether you'd like parentheses matching (a great feature for many languages)." A recent addition for JCL is to highlight improper lowercase text usage, he added.
When Dan first learned ISPF, he pressed F1 and completed the entire tutorial. "As an intern, I quickly knew more than programmers that had used it for many years," he said. A nice feature of ISPF Help is the Index, and users can enter "I" from any help panel to access the Index. "You can press Enter continually to look at every entry or enter a character (like ‘E’) to jump to a particular section," he indicated. "In addition to learning the basic line commands, knowing every option for the Find, Change, and Exclude primary commands and the use of line labels will pay great dividends, especially when writing edit macros." Every organization needs to have a toolmaker. "If you don’t have one, it is a great opportunity to grow your skills," he advised. "Learn Rexx and start writing some ISPF dialogs and edit macros – and, of course, SHARE."