z/OS Kung-fu Moves

#1 ISPF Combo moves 

By far the easiest way to master z/OS is to learn how to navigate and edit with ISPF really quickly, and the best way to bring swiftness to ISPF is through some choice combo moves.
Screenshot here of the ISPF Primary Option Menu.
I’m going to open up a dataset and play around to show some simple yet effective combo moves to get things done faster in ISPF.
To open a dataset for editing, enter one the following on the Option ===> prompt
            =3.4 or =3;4
These are shortcuts that concatenate the commands for going to the “3” Utilities and then the “4  Dslist panel.  This allows you to quickly navigate to DSList, which is one of the most powerful utilities in ISPF.

Once the “Data Set List Utility” is displayed, I can enter a Data Set name.  In this case, I’ve forgotten the exact Low-level Qualifier (LLQ) of my Data Set that I’d like to select. However, since I remember part of the dataset qualifiers, I can use wildcards “*” to help me out.  By entering BS9U.DEVT3.CLIB*, I can see all matching datasets.

Note: An LLQ is the last qualifier in a data set.  It’s the segment after the last “.”

This brings up a list of all the datasets that matched my dataset name parameters.  In this case, I see CLIBANDER, CLIBJAS, CLIBJAS3, CLIBPAU, CLIBRIC, CLIBSUT, and CLIBTOM

Hmm, it seems that I still can’t remember which of these data sets might contain the data I’m interested in, let alone the name of the particular member! 
Rather than thumbing through each data set, I decide to use a little-known command:
SRCHFOR [string]
This command invokes SuperC  [=3.12] to search for that string.  In this case I’m looking for the member that has the word “Coffee” in it.

The string is found in one of the data sets, in this case BS9U.DEVT3.CLIBPAU

Once I know the data set, there are two ways to find which member I want. 

Firstly, I can look in the output data set from SuperC, which is stored my default at userid.SRCHDSL.LIST

Secondly, I can simply  an “E” (for edit) next to the dataset, in this case BS9U.DEVT3.CLIBPAU, and issue SRCHFOR COFFEE again.  This time the search will be executed within the context of the data set, identifying the particular member I’m interested in.

It turns out that the member “TIMMIES” is the one I want.  (Here in Canada we drink a lot of Tim Horton’s coffee).

Now it’s time to edit this member, I place an “E” (edit) next to TIMMIES to edit this lovely member…a simple REXX program I wrote a few years ago available @ http://paulywill.com/mainframes/first_rexx_program

Since it’s been a few years since I’ve written this REXX EXEC, perhaps I’ve since given up coffee and switched to tea.  So naturally I’ll have to change every instance of “Coffee” to “Tea”.
First I want to see how many instances of the string “Coffee” are in this program using the find command:
F all coffee

Notice that the results are not case sensitive.
From the “ISPF Edit and Edit Macros ISPF Edit and Edit Macros” manual:

Once I’ve selected all of the strings I’d like to replace using using the FIND (or F) command, I can then change all the instances of “Coffee” to “Tea with the CHANGE (or C) command as follows:
C all Coffee Tea

Mmm… refreshing Canadian Tea.

Now that Tea Time is over, let’s add some more Kung-Fu

First, go ahead and change the strings back from tea to coffee using the following commands:

F all Tea
C all Tea Coffee

Now that we’re back to coffee, let’s assume I just want to display the lines with instances of  “coffee” and exclude all other lines of text in this member.

I could first use the EXCLUDE ALL (or X ALL) command to hide all of the lines of text:

Then I could follow that with a find command for all lines with the String Coffee (here we specify ‘all’ to find all result):
fcoffee all

Then we can hide all of the ugly “Line(s) not Displayed” overlays by specifying:
            x hide

Let’s speed things up…

Let’s setup some of our keys so we’ll never have to enter those commands again.
Enter “Keys” at the command line to open up the “Keylist”.

If you scroll down (F8) you’ll notice it goes up to F24.  By pressing shift you can access this extra set of F keys for your own use.
For example you see that I have designated:
  • F21 (Shift + F9) has the SWAP command to switch between split screens (we can cover setting up split screens like a super star on another Kung-Fu Move) 
  • F22 (Shift + F10) has a reset command (RES) 
  • F23 (Shift + F11) has the commands we just entered EXCLUDE ALL; HIDE X; 
  • F24 (Shift + F12) has the CRETRIEV command which I use ALL THE TIME!!!  If the cursor is not on the command line it will place the cursor there; if I keeping hitting the key it will cycle through the last commands I entered,
Back to our example I could have:

  1. Opened the member with EDIT
  2. Excluded all the lines and hide exclude information with my F23 key (x all;hidex)
  3. Used the FIND command to find all the instances (f all coffee) 
  4. Made all the changes (C all Coffee Tea)
  5. Pressed F22 to reset the screen and see our changes 
  6. Saved changes with the SAVE command (my F4 key)
Boom!  All done.
Knowing some basic ISPF navigation, little known commands, and doing some basic KEY setup can speed things up.
For more Kung-Fu moves from others:
Google  “100 COOL MAINFRAME TIPS by Johnathan Jeban Martin”
Google “ISPF Hidden Treasures by Peter Van Dyke”

Flawless Victory!

Paul Gamble
Graduate of Georgian College, Computer Programmer Analyst program

After doing a four month internship with the Canadian Government, Paul was offered the rare opportunity to work in their on-site Data Centre. Starting out as an Operator for four years before becoming a Systems Programmer rolling out different independent software vendors (ISVs) and different IBM Tivoli products for monitoring and automation to the z/OS platform. Paul enjoys the constant learning the z/OS operating system offers in comparison to other platforms. On weekends you’ll find Paul getting his adrenalin fix by instructing and coaching at the local skydiving drop-zone.
Connect with Paul on LinkedIn

5 thoughts on “z/OS Kung-fu Moves I: ISPF Combo Moves

    • That’s a really good one!

      You might have to create a JCL job or something similar to exploit the ISPF functions.

      What exactly do you have to change in the members? Multiple lines? Just one?

      I’ll see if I can create a solution.

      • Hi Paul. Thank you very much for your speedy response! Since my post above, I found a way to replace a text string across all members of a single PDS. Where I work we have something called STARTOOL on the mainframe and there is a utility to search all members for a string, then replace the found text string with a replace text string everywhere at once. Pretty slick! What it doesn’t do though, that would be really cool, would be to find/replace an entire found code stub that might run on 2 or 3 lines with another stub that also might run on 2 or 3 lines. I don’t know how I would do that. It might be more trouble than it’s worth to figure this out though unless one needed to do it in more than a couple dozen or so places. One of my programmers needs to do this. At least now I can show him how to first find out how much of a problem he is facing. Thanks again !

  1. Hi Paul, do you dabble with Ishell and writing REXX CGi programs? I have lots of examples of accessing things like SDSF and other IBM basic utilities from the web. I used to work (in the 90’s no less) putting web front-ends on IBM and CA products. I haven’t done that work for years (18!) but I have examples if you are interested.


Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>