Systems Programmers Tips and Tricks for ISPF
A look at the time-sharing option and other ISPF topics.
Note: This is the third and final part of a series on ISPF customization and optimization for mainframe systems professionals.
In my first article in this series, which ran in the November/December 2005 issue of the magazine, I covered some Interactive System Productivity Facility (ISPF) environment recommendations plus a quick rundown of DSLIST customizations. In my second installment, which ran in the March/April issue, I focused on the ISPF Editor and SDSF. In this issue, I cover a range of topics that didn’t conveniently fit into the categories I’ve covered so far, beginning with time-sharing option (TSO).
TSO
Here are some more keystroke-saving techniques you can incorporate into your own style of interaction with the mainframe. The TSO command parser is highly efficient and can determine the command you wish to use from a minimum number of characters needed to uniquely identify the command.
Many TSO commands also have short versions as an alternative to their full command name. This same syntax prediction occurs with command-keyword parameters as well as the base-command names. A couple of example commands issued many times daily by systems programmers all over the world serve to demonstrate the point:
LISTCAT ENTRY(dataset) ALIAS, can also be issued as:
LISTC ENT(dataset) ALI, or the “short form” of LISTCAT below:
LC ENT(dataset) ALI – much less typing.
A RACF command as another example:
LISTDSD DATASET(dataset) AUTH GENERIC
LISTDSD DA(dataset) AU GE, and the short form of LISTDSD:
LD DA(dataset) AU GEĀ
I know which versions I prefer to type in 20 times a day.
From the ISPF command line, issue the PROFILE command (TSO PROFILE), which will list your current PROFILE details. I set the PROFILE PREFIX(myHLQ) and PROFILE WTPMSG as default options. The first sets the default dataset-name prefix used in ISPF for unqualified dataset names, while the second ensures I receive all write-to-programmer messages sent to my terminal.
The TSO command ALTLIB is used to manage datasets containing REXX Execs or Clists allocated dynamically after logon. These datasets are usually allocated by applications within the ISPF environment. The command TSO ALTLIB DISPLAY shows these datasets in the search order ahead of the DD names SYSEXEC and SYSPROC, which is useful when debugging Clists or REXX.
Remember, almost all TSO commands have matching short forms. If you use any command more than a few times daily, it’s worthwhile experimenting to find the shortest working version (e.g., TSO PROF PRE(MyHLQ) or TSO ALTLIB DIS).
ISPF Commands
There are far too many ISPF commands available to list. What follows is a brief description of some of the most useful, or the most recently added features that I didn’t have space to include before.
PANELID and MSGID are two features available for many years in ISPF, and are especially useful for anyone doing ISPF Dialog development or testing. Issue PANELID as a Primary Command (i.e., from the Command ===> line) to see the PDS member name of the current ISPF Dialog Panel. Use MSGID in the same way to view the Message Number of the current or most recent ISPF Dialog Message. Armed with the name or number of the Panel or Message, you can then use DDLIST to locate the exact dataset the ISPF dialog component was called from.
A more recently added feature is Reference Lists. In times past, many systems programmers have written a dataset-list utility, and quite a few vendor products have provided similar functions. Usually, the task of writing one from scratch is performed as part of your education in the creation of ISPF Dialogs. Today, IBM provides this feature built into ISPF for you. I’m interested to know what functionality junior systems programmers add to ISPF for their training exercises (reader comments are welcome, as usual).
Some useful primary commands for the Reference List feature include:
REFACTD & REFLISTD: Opens the current personal dataset list; displays the last 30 datasets you have edited
REFACTL & REFOPENL: Opens the current personal library list; displays the last eight libraries you have edited
REFOPEND: Displays the list of personal dataset lists
REFOPENL: Displays the list of personal library lists
REFADDD: Adds the last-referenced dataset to a Reference List and requires the Reference List Name as a parameter (e.g., REFADDD TEST adds the last dataset referenced to the Reference List named TEST; TEST is created if it doesn’t already exist)
REFADDL: Same as REFADDD, but for Libraries
If you like to use the Point and Shoot fields available from the top line of all ISPF screens, a great alternative to disabling the “Tab to action bar choices” check-box under ISPF Option 0 is to leave the “Tab to action bar choices” on, and set your PF12 key to the command CRETRIEV. CRETRIEV works exactly like RETRIEVE with the added feature that, the first time you use it, no command is retrieved. Rather, the cursor is simply returned to the command line.
If you use custom logon execs invoked by your TSO Logon Procedure, the ISPLIBD command may be useful. ISPLIBD invoked at the command line displays ISPF libraries allocated using the ISPF LIBDEF service.
DSLIST
MEMBER and SRCHFOR are two features that systems programmers have added themselves using combinations of REXX, Clist and edit macros for many years. It’s great to see IBM add formal support for this kind of requirement.
Both commands are issued from the DSLIST display Data Sets Matching panel. MEMBER scans all PDSs for a member matching the first parameter given to the MEMBER command (e.g., MEMBER TEST finds the PDS member test and highlights the PDS containing it). You can also use masks (i.e., MEMBER TES* will also find TEST and any other member starting with TES). Wildcards can occur anywhere in the search parameter, so MEMBER *ES* will also work.
SRCHFOR invokes ISPF option 3.15 (Search-For) in the foreground on the list of datasets currently displayed. SRCHFOR is used to find strings within the data rather than dataset names. I find the most useful functionality is available when I select the SRCHFOR options “Any case” and “View output” on the panel invoked after entering SRCHFOR on the command line. The “Exclude not found” option can also be helpful if you’re displaying a large list of datasets.
Four useful alternatives to using PF11 in the DSLIST Data Sets Matching panel are the Primary Commands VS (space view), VA (attributes view), VT (total view) and VV (volume view – the default). These display the same information as pressing PF11 repeatedly.
Used in combination with the aforementioned Dataset Reference Lists, the APPEND command allows you to mix and match the current Data Set Matching display with one or more of your personal reference lists. Issued with no parameters at the command line, APPEND will present a list of your Dataset Reference Lists for you to choose one from, or you can issue the command as APPEND TEST – where TEST was previously defined using REFADDD. This will add all datasets in the TEST reference list to the list of datasets currently being displayed.
Following are a few more suggestions for streamlining your use of DSLIST. The equals sign “=” issued as a line command against a dataset in the Data Set Matching panel will repeat the previous command. If a command requires a dataset name as a parameter or keyword value, substitute the forward slash “/” and ISPF will replace this with the fully qualified dataset name. Examples where this applies are the LISTCAT and the LISTDSD commands when issued from DSLIST (e.g., LD DA(/) AU GE – entered as a line command against a dataset in DSLIST will list the RACF* dataset profile that applies). The same works for LC ENT(/).
The final keystroke saver is in the initial DSLIST screen where you enter the dataset mask or prefix – you don’t have to clear the remainder of the line. All it takes to delimit the current selection mask is a space. So, if you previously typed a 20-character mask (e.g., SYS1.TESTING.DATASET) and now you want to look at all datasets starting with SYS1, just overtype the dot “.” after SYS1 with a blank and save yourself from typing in the full TESTING.DATASET string again the next time you want it.
ISPF Editor
A big “thank you” to those of you who contributed the answer to my last article’s question – how to remove the point-and-shoot fields entirely when using the editor. You can achieve this with the command EDSET issued while actually editing a dataset. In the EDSET panel, select the option “Remove action bars in ISPF edit and view panels.” On a related topic, if you want to remove the point-and-shoot fields in SDSF, use the SET SCREEN command.
On looking through the other articles in this series, I am astonished that, before now, I’ve neglected to mention the RECOVERY command. Activated by issuing REC ON at the command line in an Edit session, RECOVERY allows you to step back through changes made to the dataset during the current Edit session. Enter the UNDO command to restore the dataset to the point before you last pressed Enter.
Other favorites of mine are the CREATE and REPLACE commands. Used to copy datasets or partial data from a dataset, CREATE, as the name implies, will create a new dataset based on the current Copy block – the lines between CC and CC. Alternatively, use REPLACE if you need to update an existing dataset. Typing CREATE at the Edit Command line with no parameters will invoke ISPF option 3.2 to allocate a new dataset. Use CREATE “member-name” to create a new member in the current PDS. REPLACE works similarly.
SOME REXX
Now for the question for this issue: How do you log off automatically? Many years ago, while learning the tips and tricks presented in these articles, I became frustrated at the number of keystrokes it took me just to log off TSO.
I created a REXX Exec and placed this in my SYSEXEC concatenation, naming it “LO” for “LOGOFF.” In this Exec, I had somehow figured out how to exit ISPF from within an ISPF session, then used the REXX PUSH function to inject the command “LOGOFF” into the TSO command stack. Then, I could just type “TSO %LO” from any command line in ISPF. ISPF would then shut down and TSO would regain control and process the LOGOFF command pending in the stack, thus cleanly and quickly logging me off the system. I’ve tried to create such an Exec again recently and failed. Any suggestions?