SlideShare a Scribd company logo
1 of 54
1




     TSO Productivity:

Making your (TSO) life easier




                                  By Dan O'Dea
                     Last Update March 23, 2005

                                          ∆ΦΟ
2


                     Table of Contents
Introduction and Goals        3   The ISPF Editor continued
                                    Primary Commands continued
In The Beginning              4       External Data Commands 28
  Starting ISPF. . . . .      4         Create and Replace. . 28
                                        Copy and Move . . . . 29
Setting up ISPF. . . . .      5         Cut and Paste . . . . 30
  ISPF settings. . . . .      5         Models. . . . . . . . 30
  Log and List settings.      6     Line Commands              31
  Stringing Commands . .      8       Insert, Delete, Replace,
  The ISPF Main Menu . .      9         Copy, and Move. . . . 32
                                      Column Shifting . . . . 33
Getting Around in ISPF   .   10       Data Shifting . . . . . 34
  The JUMP function. .   .   10       Exclude and “Show”. . . 35
  The Action Bars. . .   .   11       Text Handling            36
  ISPF Commands. . . .   .   11         Case, Text Split. . . 36
                                        Text Flow and Entry . 37
The ISPF Editor. . . . . 13           Miscellaneous (BNDS,
  A Word on View . . . . 13             MASK, TABS, COLS) . . 38
  Labels . . . . . . . . 14             MakeData (MD) . . . . 38
  Line Numbers . . . . . 14         Edit Macros                39
  Scrolling. . . . . . . 14           Coding and Example. . . 40
  Command Abbreviation . 14         Edit Examples              41
  The EDITSET command. . 15           JCL and Masking . . . . 41
  Member Lists . . . . . 16           Highlighting. . . . . . 43
  Member Selection . . . 17           Sort, Exclude, BNDS . . 44
  Edit Profiles. . . . . 17         Edit/Member List Tricks    48
  Profile Settings (MASK,             Wild Cards. . . . . . . 48
    BOUNDS, RECOVERY,                 Member Masks. . . . . . 49
    SETUNDO, NULLS). . . 19           “Many Member” commands. 49
  Tabs . . . . . . . . . 20           Copy and Paste. . . . . 49
  Primary Commands . . . 21
    Delete and Sort. . . 21       DSLIST function . . . . . .   50
    Undo, Locate, Reset,            Getting a list of files .   50
    Flip, and Bounds . . 22         Primary Commands (Find,
    Submit . . . . . . . 22           Locate, Member, Reset,
    Profile, Compare, and             Sort, SRCHFOR . . . . .   50
    Exclude. . . . . . . 24         Line Commands . . . . . .   51
    Find . . . . . . . . 26         Cheats                      52
    Change . . . . . . . 27           Using the “/” and “=” .   52
    Hilite . . . . . . . 27           Cut and Paste . . . . .   52


                 The Final Word . . . . 53
3


                                  Introduction

    This course is intended for an intermediate to advanced TSO/ISPF audience.
It assumes you know what TSO and ISPF are and how to get around in them. It
also assumes you have a basic understanding of the ISPF editor and either
CLISTs or the REXX language. You will learn about:

   •   Mod-4 and Mod-5 3278 logmodes.
   •   The ISPF SETTINGS set.
   •   The ISPF commands table.
   •   EDIT tools, including edit macros, picture strings, little-used but useful line
       commands, etc.
   •   Tips and tricks to using ISPF option 3.4, the dataset list.


                              Goals of the Course

   After this course you should be able to:

   •   Describe and log on using mod2, mod4, and mod5 3278 terminals.
   •   Start ISPF using different options.
   •   Understand ISPF settings.
   •   Set your function keys to use one or more commands.
   •   View ISPF commands tables and read them.
   •   Select multiple PDS members at once.
   •   Use bounds, masks, and tabs effectively.
   •   Use picture strings with FIND and CHANGE.
   •   Use highlighting effectively.
   •   Pass data to and from an edit session.
   •   Exclude and show lines.
   •   Handle text properly.
   •   Write a simple edit macro.
   •   Handle datasets from the DSLIST option.
   •   Use the slash and equals sign in DLIST.


                                  Format Note

    The basic font for this document is Arial 12. TSO commands are given in
Courier New 12. Screen prints are shown in Courier New 9, with comments in
Arial 10. Sidebars or extra comments are in Times New Roman 12.
4


                         A Word About Logging On

   Nearly everyone logs on using the default LTERM of a 3279 model 2. That
terminal type displays 24 lines of 80 bytes each. There are other terminal types;
two useful ones are 3278-4 and 3278-5.

   The Model 4 terminal is less familiar to people. I find it useful because it
displays 43 lines instead of the usual 24. Seeing more lines in the dataset I’m
editing lets me do less scrolling, and I get to see more code when I’m trying to
create or modify REXX execs or JCL.

   To log on using a Mod-4 terminal, on the stag screen type:

LOGON APPLID(<TSO ID>) LOGMODE(SNX32704)

   The Model 5 terminal displays 24 lines of 132 characters, which is useful for
displaying sysouts or wide datasets. The logmode to use is SNX32705.


                              “In The Beginning”

    We do just about all our work in ISPF. It seems a waste of keystrokes to log
on and then type ISPF. I start ISPF as part of my first TSO command. Here is a
brief example.

CLRSCRN
TERM NOBREAK     /* for file transfers */
ISPF

   ISPF starts at its main menu by default. That may be all right, but usually you
want to start doing something right away. Maybe, most of the time, you want to
go right to EDIT. You can start ISPF in any valid menu option. For example,
ISPF 3.4 will go first to option 3 (Utilities) of the main menu, then option 4 of
the Utilities menu (DSLIST), giving you control at the DSLIST panel.

  There are other ways to start ISPF, but they deal with creating ISPF
commands or Dialog Manager programming. They are discussed later.

   Dialog Manager is beyond the scope of this course. I have a course on
Dialog Manager if you’re interested in really improving your productivity.
5


            “All Right, I’m In, Now What?”: ISPF Settings

  The first thing to do in ISPF is to make sure your settings are what you want.
The settings menu looks like this:
  Log/List Function keys Colors Environ Workstation Identifier Help
-----------------------------------------------------------------------
                                ISPF Settings
Command ===>
                                                                   More:          +
Options                                   Print Graphics
  Enter "/" to select option                Family printer type 2
     Command line at bottom                 Device name . . . .
  / Panel display CUA mode                  Aspect ratio . . . 0
  / Long message in pop-up
     Tab to action bar choices
     Tab to point-and-shoot fields        General
  / Restore TEST/TRACE options              Input field pad . . N
     Session Manager mode                   Command delimiter . ;
  / Jump from leader dots
     Edit PRINTDS Command
     Always show split line
     Enable EURO sign

Terminal Characteristics
  Screen format   2 1. Data        2. Std       3. Max      4. Part

  Terminal Type   3     1. 3277         2. 3277A         3. 3278      4. 3278A
                        5. 3290A        6. 3278T         7. 3278CF    8. 3277KN



   My preferences are above. Your settings may be different depending on how
you want to use ISPF. I chose to change the defaults for these reasons:

   •   Command line at bottom off, tab to action bar choices off: I prefer to get to
       the command line with a single keystroke (the HOME key). If the
       command line is at the bottom, or if the action bar is tab-able, there is no
       way to do that. Even with the “tab to action bar” off, you can still use the
       action bar by placing your cursor on it and hitting ENTER.
   •   Long message in pop-up lets ISPF display long messages at the bottom of
       the screen rather than restricting it to the line immediately following the
       command line. In the latter case the long message may not always be
       displayed in its entirety. On a Mod2 terminal, though, the message box
       may obscure too many lines (a minimum of three) for your taste.
   •   Always show split line off gives me another line on full-screen splits. The
       split line always shows up on non-full screen splits.

   One other thing to keep in mind from this screen is the “Command delimiter,”
the character used to separate ISPF commands. Remember what it is; we’ll
refer to it later.
6


                    Settings 2: the Log and List Datasets

   Let’s look at the settings action bar. The first choice is Log/List. ISPF
defaults to logging ISPF commands and errors from your session. There’s no
need to log your ISPF session unless you’re running into problems. Go into the
Log/List pull-down menu and choose option 1, Log Defaults. To turn off the ISPF
log, set the process option to 4 (just in case you need it) and change the primary
and secondary pages to 0. That prevents ISPF from allocating a log.

   To log your ISPF session, go back into this settings menu and increase the
number of pages to 200 or so. Get out of ISPF, and then go back in and work as
you normally would.

   When the log allocations are done, go back into the same menu and choose
option 2, List Defaults. Increase the number of pages to 200 and change the
process option to 3. The list dataset will not be created unless you need it, and
process option 3 will keep it when you leave ISPF.


                                  Settings 3, Keys 24

   The second choice on the action bar is the Function Keys. You can get to the
function keys via the KEYS command and the key lists via the KEYLIST
command. This is where you set your function keys. The main defaults are:

F1 . . . HELP
F2 . . . SPLIT
F3 . . . EXIT            synonym for “END”
F4 . . . RETURN          go back to main menu
F5 . . . RFIND
F6 . . . RCHANGE
F7 . . . BACKWARD synonym for “UP”
F8 . . . FORWARD         synonym for “DOWN”
F9 . . . SWAP
F10 . . LEFT
F11 . . RIGHT
F12 . . CRETRIEV Conditional retrieve. If on command line, retrieve the previous
command. If not on the command line, place the cursor at the beginning of the first input field on
the panel.

   The second set of function keys (13 – 24) is identical to the first.

   Primary function key values are shown at the bottom of a panel by default. I
turn that off because it blocks part of the display. To turn off this display, use the
command PFSHOW OFF. To turn the key display back on, use PFSHOW.
7


                       Function Key Settings continued

  I’ve changed my function keys and set up some quirks with my keyboard.
Here are my primary function keys; my changes are in lower case.

F1 .   .   .   HELP
F2 .   .   .   SPLIT;
F3 .   .   .   end
F4 .   .   .   tso
F5 .   .   .   RFIND
F6 .   .   .   nop
F7 .   .   .   up
F8 .   .   .   down
F9 .   .   .   SWAP
F10    .   .   LEFT
F11    .   .   RIGHT
F12    .   .   sub;end;tso ej;st

   Look at F2. Remember the semicolon (;) as the command delimiter? The “;”
on the end of the SPLIT command lets me split the screen and do something.
For example, if I want to split from an edit session and get into DSLIST on the
other screen, I enter “3.4” on the command line and hit my F2 key.

  The semicolon lets me run many commands from a single function key. Note
F12; this single key

   •    Submits the JCL I’m currently editing, then saves it;
   •    Puts me into EJES;
   •    Selects the STATUS command.

   You can run a TSO command from the command line by prefixing the
command with the letters TSO. I have set my F4 key to TSO so I don’t have to
type those letters. That reduces my keystrokes by three.

   I’ve set my keyboard so the F6 key is “Erase End of Line” (EOL). The EOL
key is “End” by default, but I use “End” to refer to the end of the field I’m on. I
don’t use the RCHANGE key, so that was a good candidate to use as EOL. To
make sure nothing else happens when using this key, I change the function to No
Operation (NOP).
8


                     Function Key settings continued

   Most people ignore their second set of function keys (keys 13 – 24). There’s
nothing wrong with that, but these keys can be set to less-used but still useful
commands or command strings. Here are a few examples:

   •   Set function key 19 to TOP and function key 20 to BOTTOM. Those
       commands scroll to the top and bottom of any data list immediately, just
       like UP MAX or DOWN MAX.
   •   Set a commonly-used edit macro.
   •   Set F24 to RETURN. That command gets you out of the application
       you’re in back to the previous application.
   •   Set a key to any CLIST, REXX exec, or TSO command you often use,
       prefixed by TSO (e. g. TSO LISTC);
   •   If you commonly create or edit IDCAMS commands, then submit them in
       an IDCAMS job, you can set up a function key to END;SUB IDCAMS;TSO
       EJ;ST. That string of commands will save and exit the command parm,
       submit the JCL to run it, go into EJES, and bring up the STATUS on your
       submitted job. If your parms are in a separate PDS from your JCL, simply
       alter the member name to a fully qualified dataset name (e. g. TSO
       SUBMIT ‘<yourid>.CNTL(IDCAMS)’).

  In short, a function key can be set to anything you can type on an ISPF
command line.


                     A Bonus: Command Line Strings

    The reverse is also true: you can type a string of commands on the command
line, separated by semicolons, and repeat it using the RETRIEVE command.
Here’s an example.

    Say you need to create five copies, numbered 1 – 5, of a job to read five
partitions of a database. Assume the database name is PDB0.AD1010xD, where
“x” is 1 – 5. Once the first member (say, SCANAD01) is done and saved, on the
command line type:

       s SCANAD02;copy SCANAD01;c AD10101D AD10102D all;end

Then hit RETRIEVE, change the 02s to be 03, 04, and 05 in succession, hitting
ENTER after each one. Now you have all five members created. This works as
long as you plan carefully.
9


                              The ISPF Main Menu

     The default setting of the main panel displays session information:
 0   Settings       Terminal and user parameters            User ID . :    @TSSQ04
 1   View           Display source data or listings         Time. . . :    10:32
 2   Edit           Create or change source data            Terminal. :    3278
 3   Utilities      Perform utility functions               Screen. . :    1
 4   Foreground     Interactive language processing         Language. :    ENGLISH
 5   Batch          Submit job for language processing      Appl ID . :    DBA
 6   Command        Enter TSO or Workstation commands       TSO logon :    TMP
 7   Dialog Test    Perform dialog testing                  TSO prefix:    @TSSQ04
 8   LM Facility    Library administrator functions         System ID :    SR1
 9   IBM Products   IBM program development products        MVS acct. :    **NONE**
10   SCLM           SW Configuration Library Manager        Release . :    ISPF 5.2



   There are other settings, set under the STATUS pull-down menu. I use the
Calendar option.
 0   Settings       Terminal and user parameters            <       Calendar       >
 1   View           Display source data or listings              October   2004
 2   Edit           Create or change source data            Su   Mo Tu We Th Fr   Sa
 3   Utilities      Perform utility functions                                 1    2
 4   Foreground     Interactive language processing          3    4 5 6 7 8        9
 5   Batch          Submit job for language processing      10   11 12 13 14 15   16
 6   Command        Enter TSO or Workstation commands       17   18 19 20 21 22   23
 7   Dialog Test    Perform dialog testing                  24   25 26 27 28 29   30
 8   LM Facility    Library administrator functions         31
 9   IBM Products   IBM program development products        Time . . . . : 10:34
10   SCLM           SW Configuration Library Manager        Day of year. :   299



   There are two advantages to this display. One is the ability to see Julian date
equivalents for Gregorian dates. Use the “<” and “>” point and shoot fields to
select a calendar month, then put the cursor on a day and hit ENTER. A pop-up
panel shows you the Julian date for that day.

    Another thing you can do is to place your cursor on the “Day of year” field
and hit ENTER. A pop-up panel lets you enter any Julian date and convert it to a
Gregorian date. Hit F3 to exit the panel.

     There are two STATUS settings. When the screen is split, the second
setting operates in the second screen. You must set this option twice, once in
each screen.
10


                              Getting around in ISPF

   There are two main ways to get around in ISPF: going through the menus
and using the JUMP function. There is an annoying problem with those
methods: you have to completely stop what you’re doing. There are two ways to
do something without losing your current task.

   One way is to use the action bars displayed above most panels. For
example, on the EDIT main panel (in bold):
   Menu RefList RefMode Utilities Workstation Help
-----------------------------------------------------------------------
                                Edit Entry Panel
 Command ===>

 ISPF Library:
    Project . .   . @TSSQ04
    Group . . .   . SN1       . . .            . . .         . . .
    Type . . .    . CNTL
    Member . .    .                   (Blank or pattern for member selection list)

 Other Partitioned, Sequential or VSAM Data Set:
    Data Set Name . . .
    Volume Serial . . .           (If not cataloged)

 Workstation File:
    File Name . . . . .
                                             Options
 Initial Macro . .    .   .                     Confirm Cancel/Move/Replace
 Profile Name . . .   .   .                     Mixed Mode
 Format Name . . .    .   .                     Edit on Workstation
 Data Set Password    .   .                     Preserve VB record length


    If “Tab To Action Bar Choices” is enabled, the HOME key takes you to the
left-most action bar item. If you’ve turned that off you can still use the action bar
by placing the cursor manually over your choice. When you hit ENTER a pull-
down menu is displayed.

   The action bar eliminates the problem of the jump function by bringing you
back to your active task when the chosen task is complete. However, the action
bars do not list all possible choices, so you are limited to what you can do. As
with most things, fortunately, there are ways around this limit.
11


                      Getting around in ISPF Redux:
                          The Commands Table

   You can write your own ISPF commands to run existing or new functions. To
manage ISPF commands, use option 3.9 to create a commands table. The first
screen for the ISPF commands table interface looks like this:
.------------------------------- Commands --------------------------------.
|                          Command Table Utility                          |
| Command ===>                                                            |
|                                                                         |
|   Specifications                            Command search order        |
|   Application ID . . DBA                    Application table : DBA     |
|   Enter "/" to select option                User table . . . . :        |
|      Show description field                 Site table . . . . :        |
|                                             System table . . . : ISP    |
|                                                                         |
| If no application ID is specified, the current application ID will be   |
| used. The name of the command table to be processed is formed by        |
| prefixing the application id to the string 'CMDS'. For example:         |
| Application ID . . TST results in a command table name of 'TSTCMDS'. |
|                                                                         |
|                                                                         |
|                                                                         |
'-------------------------------------------------------------------------'


   The Application ID field tells ISPF the name of the commands table. You can
choose any two-, three-, or four-character application ID you want as long as it’s
not ISR or ISP. In the print above DBACMDS is the commands table for the
DBSS Toolbox.

  This utility displays your active commands table without allowing changes. To
make changes you must run under a different application ID, make the changes,
and then restart ISPF with the correct applid.
12


                         The Commands Table continued

   Here are a few commands from the ISR/ISP command list display:
Verb       T   Action
BACKWARD   0   ALIAS UP               BACKWARD = UP
BOTTOM     0   ALIAS DOWN MAX
FORWARD    0   ALIAS DOWN
TOP        0   ALIAS UP MAX
ACTIONS    0   ACTIONS
AUTOTYPE   0   SETVERB                This is an existing command
CANCEL     3   CANCEL                 Provides the abbreviation CAN
CMDE       0   SELECT PGM(ISPCCMDE)   Calls a dialog program



   To invoke a commands table, ISPF must be started with that application ID.
Unfortunately, the ISPF or PDF commands do not allow you to easily specify the
application ID. You must write your own ISPF-equivalent command to do that
using the ISPSTART command. As an example, the command to start ISPF
using the DBA commands table is:

      ISPSTART PANEL(ISR@PRIM) NEWAPPL(DBA)

ISR@PRIM is the primary menu panel for ISPF. The NEWAPPL argument must
be the same as the application ID you gave your commands table.

   It’s up to you to determine whether coding this (and remembering a different
ISPF command) is better than working without a separate commands table.

  Here is the DBA commands table. Note the execution calls are to the Dialog
Manager Select service:
Verb       T   Action
DLIST      0   SELECT   PGM(ISRUDL) PARM(ISRUDLP)
PANVALET   4   SELECT   PGM(PSPILINI) NOCHECK
PRS        0   SELECT   CMD(PRB#PRS)
QW         0   SELECT   CMD(QW)
DEBUG      0   SELECT   CMD($DEBUG ON)
NODEBUG    0   SELECT   CMD($DEBUG OFF)
TON        0   SELECT   CMD($DEBUG ON)
TOFF       0   SELECT   CMD($DEBUG OFF)
BM         0   SELECT   CMD(BOOKMGR)
DBTOOLS    3   SELECT   PANEL(DO$TOOLS)
AFMON      3   SELECT   CMD(AFMON)
FAMVS      0   SELECT   CMD(FAMENU)
FAIMS      0   SELECT   CMD(FIMENU)
SUPPORT    0   SELECT   CMD(SUPPORT)
EJ         0   SELECT   PGM(EJ) PARM(&EJTRAIL) NEWAPPL(EJES) NOCHECK


   If you’d like to implement this concept I’d be happy to help.
13


                Getting the Most from the ISPF Editor

   Whether we realize it or not, the majority of our work is done in the ISPF
editor. The editor is a very powerful tool, with many features we can use with a
minimum of training.


                         But First, a Word on View

   View lets you use the editor commands on a file without the risk of
accidentally changing it. Almost everything said about Edit applies to View.


                            Edit and Line Labels

   The numbers on the left of any edit session are not true line numbers; they
are line labels. This is where line commands go. Although they are renumbered
when you renumber your data, they are valid only in a given edit session.

   Line labels are used for messages as well as marking locations. Some
examples of messages are =NOTE=, ==CHG> (the line has one or more
changes on it), or dashes (one or more excluded lines). Three labels are defined
but are not displayed: .ZFIRST, .ZLAST, and .ZCSR (for first, last, and
cursor’s line). First and last can be abbreviated as .ZF and .ZL respectively.

   You can create your own labels. Just start the label line with a period and
type a name for that line. For example, in bold below:
  File Edit Edit_Settings Menu Utilities Compilers Test Help
-------------------------------------------------------------------------------
EDIT       @TSSQ04.SN1.EXEC(DFOICF) - 01.03                Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 /* REXX    DFO's copy of ICF to preserve my own allocations.           */
000002 /*                                                                     */
000003 /* Original code in 'TSOPROC.CLIST(ICF)'.                              */
000004 /*--------------------------------------------------------------------*/
.HERE "PROF MSGID"                        Label “HERE”
000006 CVT = C2X(STORAGE(10,4))
000007 CVT_154 = D2X(X2D(CVT) + X2D(154))
000008 CVT_M20 = D2X(X2D(CVT_154,8))
000009 SID = STRIP(STORAGE(CVT_154,8))
.THERE PID = SUBSTR(SID,2,1)              Label “THERE”

   Labels are useful to set ranges for primary commands or to quickly get to one
or more areas in your dataset. This topic is discussed further under the primary
commands section.
14


                             Data Line Numbers

   Data line numbers are optional. If you want data line numbers, you must use
the NUMBER ON command. Numbers are often used in COBOL, Assembler, or
JCL. Respectively, NUMBER ON COB or NUMBER ON STD sets the proper
numbers. To automatically maintain line numbers, use the AUTONUM command.


                                    Scrolling

    The scrolling amount is displayed in the upper right of the session. I’ve found
it useful to set this to CSR, or cursor. That lets me decide how much to scroll.
You can always override the scroll amount by typing the amount on the
command line and hitting the scroll key, or by typing the scroll command followed
by the amount. For example, to scroll down five lines:

   Command ===> down 5
   Command ===> 5               followed by the F8 key.

   Scrolling obeys BOUNDS (see below). If the scroll amount exceeds the
BOUNDS limit, scrolling stops at the bound. To scroll past the bound hit the
same scroll key again. The upper limit to scrolling (except MAX) is 9,999 lines or
columns.


                          Command Abbreviations

   Almost all primary commands can be abbreviated. The abbreviation is usually
the shortest number of characters used to exclusively identify the command. For
example, two commands begin with “RE”: RESET and RENUM. Specifying RE
as your command will result in an error. However, you can use RES and REN
respectively instead of typing the command name completely.

    The abbreviation for some commands is not the first three characters. An
example is C or CHG for the CHANGE command. Some commands use both;
for example, EX and X are both valid abbreviations for the EXCLUDE command.
15


                           The EDITSET command

  Some edit parameters can be set using the EDITSET (EDSET) command.
The command displays a pop-up menu to set up your edit session defaults.
.-----------------------------------------------------------------------------.
|                           Edit and View Settings                            |
| Command ===>                                                                |
|                                                                More:     + |
| Settings for current and future Edit and View sessions:                     |
|                                                                             |
|   User session initial macro . . . . . . . . . . . . . . DFOIMAC            |
|   Maximum initial storage allowed for Edit and View . .      0              |
|   Target line for Find/Change/Exclude string . . . . . . 1                  |
|   Enter "/" to select option                                                |
|      Always position Find/Change/Exclude string to target line              |
|   / Remove action bars in ISPF edit and view panels                         |
|                                                                             |
|   CUT default . . 2 1. Append       PASTE default . . 2 1. Delete           |
|                      2. Replace                          2. Keep            |
|                                                                             |
| Settings for future sessions. Select Apply Setting Immediately for the      |
| setting to affect the current session as well.                              |
|                                                                             |
|   Enter "/" to select option                                                |
|      Confirm Cancel/Move/Replace           Apply Setting Immediately        |
|      Preserve VB record length             Apply Setting Immediately        |
|                                                                             |
'-----------------------------------------------------------------------------'



   To give me more room in my edit sessions I check the “Remove action
bars…” field. Action bars remain on the main edit panel and member lists but do
not appear when I’m editing data.

  I also change the target line for find/change to be 1 (the first displayed line).
That’s a personal preference, not a suggestion.
16


                               Member Selection

   The “%” and “*” characters represent a single character and many characters
respectively. This can be done anywhere you can specify a member name.
Keep in mind, using a single asterisk in place of a member name or mask is
considered the entire member list. Some examples:

   •   %%ABC selects all 5-letter member names ending in ABC;
   •   ABC* selects all members beginning with ABC;
   •   A*B*C selects all members beginning with A, ending in C, and having a B
       somewhere between the first and last characters.


                    Additional Member List Commands

    REFRESH resets the member list to what’s currently there. RESET clears the
line command and prompt fields.

   SAVE prints the member list to the LIST dataset or a dataset named on the
SAVE command. For example, SAVE BASE creates a dataset called
<yourid>.BASE.MEMBERS.

    SELECT can be used as a line or primary command. Where it is appropriate
(e. g. resetting statistics, copying), you can use the mask characters to select a
group of members (e. g. S ABC*).

   SORT can sort the member list on any of these fields:

PDSes with formatted records:       PDSes with unformatted records:

Field       Sort Sequence          Field        Sort Sequence
----------------------------       -----------------------------
NAME             Ascending         NAME              Ascending
LIB              Ascending         LIB               Ascending
VV               Ascending         SIZE              Descending
MM               Ascending         TTR               Ascending
CREATED|CRE      Descending        ALIAS-OF|ALIAS    Descending
CHANGED|CHA      Descending        AC                Ascending
SIZE             Descending        ATTRIBUTES|ATTR   Descending
INIT             Descending        AM                Descending
MOD              Descending        RM                Descending
ID               Ascending         SSI               Ascending


  This suggests a couple of little tricks. To edit the most recently changed
member, do SORT CHANGED before looking for the member. To see all
members edited by a person, type SORT ID.
17


  You can also sort on these fields by placing a cursor on the column header
and hitting ENTER.
18


           “Make Sure You Get My Best Side:” Edit Profiles

    When you edit a dataset, the editor wants to know how to handle the data. It
also has many features to help you code JCL and programs. ISPF stores this
information in edit profiles.

   ISPF uses a profile based on 1) the dataset type and 2) the LRECL of the file.
Dataset type is based on the last qualifier of the dataset name. You can have a
profile called DATA (Fixed 80), another called DATA (Fixed 133), and so on.

   ISPF limits you to 25 profile types by default; installation defaults can be different.
When a profile beyond the limit is needed, the least recently used profile is dropped from
the list to make room for the new one. If you edit many different file type/LRECL
combinations, it is possible to lose one and have to “set it up” again.

   Some useful profile options are:

RECOVERY       Recover if edit session breaks, plus allows UNDO; default is OFF
NULLS          NULLS ON allows easy insertion of characters; default is OFF
TABS           Logical, hardware or software tabs are available; default is OFF
STATS          Keeps statistics for PDS members
SETUNDO        Are UNDO capabilities on?
HILITE         Alters colors of specific characters or words

   BOUNDS and MASK settings are also stored in the profile. MASKs can be
used to preset data on inserted lines. BOUNDS defines limits for the following
primary commands: FIND, CHANGE, EXCLUDE and SORT. Bounds also affect
the operation of the text line, data shifting, and scrolling commands.

   The default lines for MASK and TAB lines are all blanks. The default bounds
are the first and last bytes of the dataset record length, minus numbers if it
applies. For example, a DATA LRECL of 80 sets the right bound to 80; a JCL
member with numbers sets the right bound to 72.
19


                           Edit Profiles continued

   The PROFILE command displays the current profile. It can also lock the
profile from further changes (PROFILE LOCK). The profile is displayed as a
series of =>PROF lines, which can be removed using the D/DD line commands or
the RESET primary command.

    MASK: when turned on, causes a mask to be presented on every inserted
line. For example, setting the MASK in a CNTL PDS as “//” begins each line with
the slashes. If you don’t want the mask on a line, it can be overtyped.

   BOUNDS: the BOUNDS primary or line command sets limits for scrolling,
text, and many other commands. The primary command BOUNDS with no
arguments resets them to the default.

   RECOVERY: when turned on, ISPF keeps track of your edit session. You
can then recover your changes if your edit session crashes. Recovery is
automatic, but you have a choice of deferring or skipping the recovery.

   RECOVERY also allows use of the UNDO edit command. UNDO works the
same way as the undo you find in Microsoft products such as Word or Excel. It
backs out all changes made since the previous ENTER or edit command.

   To turn on edit recovery, type RECOVERY ON. This is recommended.

   SETUNDO: when turned on, the edit session can use the UNDO command
without turning RECOVERY on. The command is either SETUNDO STG (do the
undo on the in-storage copy) or SETUNDO REC (do the undo in the recovery
copy). There are two advantages to SETUNDO STG:

   1. It’s faster;
   2. It does not turn recovery on.

   NULLS: by default, blanks on the end of a line are considered valid
characters (spaces). With NULLS OFF, if you try to insert characters on a line,
the insertion is not allowed. You must delete characters or erase to end-of-line
before inserting any characters. I set NULLS ON so I don’t have to constantly
delete or erase characters.
20


                               Edit: Using Tabs

    With TABS ON, the editor can determine where to put the cursor. You can let
the editor decide where to put the cursor, or use the TAB keys on your keyboard
to position the cursor. Because the tab line is used for all tabs, it may contain
asterisks, dashes, or underscores. All tabs are set using the TABS line
command.

   •   Software tabs are set by typing dashes or underscores on the TABS line
       over the areas you want to tab to. For example, this sets three tab areas:
       TABS       ----------    -------        --------


      Software tabbing does not provide tab locations, therefore the TAB key
   does not work with these tabs. The editor uses these tabs to position the
   cursor in the general area it needs to be in.

   •   Hardware tabs are accessed using the keyboard’s TAB key. The edit
       screen has two hardware tabs set: one at the line labels and one at the
       first byte of the data line. You can set more hardware tabs by placing an
       asterisk on the tab line just before you want your field to start. The editor
       will not let you type on top of a hardware tab. For example, this sets three
       tabs at positions 10, 16, and 36:
       =COLS> ----+----1----+----2----+----3----+----4----+---
       TABS           *     *                   *


      To turn off hardware (or logical) tabs, type TABS OFF (clears all tabs) or
   space out the asterisk(s) on the TABS line.

   •   Logical tabs are represented by a character, e. g. “TAB ¬”. To set data
       areas as 1-9, 10-15, 16-35, and 36-72, set up your TABS line as:
       =COLS> ----+----1----+----2----+----3----+----4----+---
       =TABS> -       *     *                   *


       When you enter lines like this:

       000100 ¬la¬0,0¬clear counter register
       000200 *¬¬¬to initial value

       the result is:
       =COLS> ----+----1----+----2----+----3----+----4----+---
       000100          LA    0,0                 CLEAR COUNTER REGISTER
       000200 *                                  TO INITIAL VALUE
21


                          Edit Primary Commands

  In no particular order, here are some useful commands you enter on the
command line. Note:

   •   Primary command operands are separated by commas or spaces.
   •   Trailing blanks are treated as nulls (you can’t use the cursor keys to make
       spaces between operands).
   •   If an error occurs, the command remains on the command line.
   •   To force the command to remain on the command line, prefix it with an
       ampersand (&).


   DELETE deletes selected lines. Lines can be selected by exclusion, non-
exclusion, or by labels. Here are two examples:

       DELETE ALL X deletes all excluded lines;
       DELETE ALL .a .b deletes all lines between label A and label B,
inclusive.

   SORT sorts data, observing bounds. The entire record is subject to sorting
unless bounds are set. If bounds are on, only the data within the bounds is
sorted and moved; other data is not moved. This is a way to sort columned data
separately.

   Sort lets you sort fields in either ascending or descending order. The
maximum number of sort fields is five. When using multiple fields, both start and
end columns must be provided. Default is ascending sort. If one field specifies
ascending or descending, all fields must specify it. Here are a few examples:

       SORT 10 sorts from column 10 to the right bound;
       SORT 1 8 sorts based on the data within columns 1 through 8 inclusive;
       SORT 1 15 X sorts all excluded lines based on the data in columns 1
through 15;
       SORT 1 15 A 20 20 D sorts all lines based on two fields, the first field
in ascending order and the second in descending order. Note the second field is
a single byte.

    EDIT calls the editor recursively. If you are editing a member and need to
briefly edit another member, and then return to your original member, typing
EDIT <member> on the command line does that. BROWSE and VIEW are similar
commands for browsing and viewing members respectively.
22


                       More Edit Primary Commands

   UNDO undoes all changes made since the previous ENTER or function key
was pressed. You can continue to undo changes until all changes have been
reversed. However, you cannot undo initial macro changes. UNDO is available
only if RECOVERY or SETUNDO is on.

   LOCATE finds a line label. The label can be the “line number”, any special
label (e. g. =NOTE=, ==ERR>), your own label, or a pending line command.
Here are a few examples:

   •   LOCATE ERR FIRST locates the first error line;
   •   LOC CHG NEXT locates the next changed line;
   •   L .HERE locates the label “.HERE”
   •   L 450 locates line label 000450;
   •   L SPECIAL locates the next special line (e. g. COLS, MASK, etc.);
   •   L LABEL PREV locates the previous label.

    RESET clears all line commands, reshows excluded lines, deletes special
lines, clears all line flags, and turns off the last FIND highlight. RESET with no
operands cleans up everything except line labels. Operands can be provided to
specify exactly what to reset:

       label        remove line labels
       command      (CMD) remove pending line commands
       error        remove ERROR notes
       change       (CHG) remove CHANGED notes
       excluded     (X) redisplays excluded lines
       special      Deletes all special lines (=PROF>, =BNDS>, =TABS>,
                    ==MSG>, =NOTE=, =MASK>, =COLS>, and ======)
       find         reset FIND highlighting

   FLIP swaps excluded and included lines.

    BOUNDS with no operands sets boundaries to the default. You can set left,
right, or both boundaries. Both left and right bounds must be supplied; an
asterisk is used as the placeholder. To set the right bound to 60 you’d type
BOUNDS * 60; to set the left bound to 10, type BOUNDS 10 *.
23


                     Edit Primary Command: Submit

   SUBMIT passes the data to the TSO SUBMIT command. You can submit all
the JCL or just that within a range. If the LRECL is greater than 80 bytes, each
record is truncated to 80 bytes. If the LRECL is less than 80 bytes, it is padded
with blanks up to 80 bytes.

    The editor submits all job streams in a single member. Job cards separate
job streams; the null statement (“//”) is not required. If you have members set up
like this and you want to submit only one of the job streams, you can mark the
job stream with labels (e. g. .HERE and .THERE) and then type SUB
.HERE .THERE to submit only that JCL.

Command ===> sub .here .there                                 Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 //SPDO001T JOB SP218ZZDFO9999A044,'ODEA 77184',USER=@TSSQ04,
000002 //       MSGLEVEL=1,MSGCLASS=H,PRTY=4,NOTIFY=@TSSQ04
000003 //*FORMAT PR,DDNAME=,DEST=TMNODE1.RM005
000004 //*MAIN CLASS=TSS04
000005 //**
000006 //STEP01    EXEC PGM=IKJEFT01,DYNAMNBR=90
000007 //**********************************************************************
000008 //*        RUN TSO AND DO WHAT IT SAYS.
000009 //**********************************************************************
000010 //SYSTSIN DD *
000011 LISTC LEVEL(@TSSQ04) ALL
000012 //SYSTSPRT DD SYSOUT=*
000013 //
.here //SPDO002T JOB SP218ZZDFO9999A044,'ODEA 77184',USER=@TSSQ04,
000015 //       MSGLEVEL=1,MSGCLASS=H,PRTY=4,NOTIFY=@TSSQ04
000016 //*FORMAT PR,DDNAME=,DEST=TMNODE1.RM005
000017 //*MAIN CLASS=TSS04
000018 //**
000019 //STEP01    EXEC PGM=IKJEFT01,DYNAMNBR=90
000020 //**********************************************************************
000021 //*        RUN TSO AND DO WHAT IT SAYS.
000022 //**********************************************************************
000023 //SYSTSIN DD *
000024 LISTC LEVEL(@TSSQ03) ALL
.there //SYSTSPRT DD SYSOUT=*
****** **************************** Bottom of Data ****************************
24


                        More Edit Primary Commands

   PROFILE displays the current edit profile. To prevent permanent changes,
use PROFILE LOCK. PROFILE UNLOCK unlocks the profile to allow changes. If
you specify a number from 0 – 8 ISPF displays that many lines of the profile.

   Even if a profile is locked, you can change it for the current session. Changes
are temporary and are dropped when you leave the session.

   You can change which profile you’re using for the current dataset by naming it
with the command. For example, to use a text profile, type PROFILE TEXT. If
the profile does not exist, ISPF creates a new one for you. To change profiles
without displaying the new one, type PROFILE <name> 0.

    COMPARE calls SuperC to compare the current edit session with another file.
Lines existing only in the current file are marked with labels. Lines existing only
in the other file are shown as information lines. You can add those lines to the
current file using the MAKEDATA command (see Edit Line Commands, MD).

   COMPARE with no arguments presents the Edit Compare Settings panel.
Otherwise a DSN or member name is required for the file to be compared to. In
place of the DSN you can use SESSION or an asterisk to compare the current
edit session with the same dataset stored on disk. Other keywords are:

   •     EXCLUDE or X excludes matching lines, leaving only differences visible;
   •     SAVE saves the output to a dataset called ISPFEDIT.COMPARE.LIST;
   •     SYSIN does not free the SYSIN DD before invoking SuperC. That lets
         you pass more parameters to SuperC.

  EXCLUDE excludes from view any lines you choose. When used as a primary
command, EXCLUDE functions as a FIND command might (see below):

   1. EXCLUDE ALL “C” 72 excludes all lines with a “C” in column 72;
   2. EX WHILE ALL excludes all lines with the text WHILE on them;
   3. X ALL excludes every line in the dataset.

   A FIND command unexcludes any lines with the find string on it. For
example, in a JCL member, to show only those lines with program names on
them (X ALL;F PGM= ALL):

******   ***************************** Top of Data ******************************
- - -    - - - - - - - - - - - - - - - - 11 Line(s) not Displayed
000012   //ACBA     EXEC PGM=DFSRRC00,PARM='UPB,'
- - -    - - - - - - - - - - - - - - - - 15 Line(s) not Displayed
000028   //ACBB     EXEC PGM=DFSRRC00,PARM='UPB,'
- - -    - - - - - - - - - - - - - - - - 15 Line(s) not Displayed
******   **************************** Bottom of Data ****************************
25


                              The FIND Command

   FIND is usually used with the operands NEXT (the default), PREVIOUS, ALL,
FIRST, or LAST. Special characters (e. g. the “*” or quotes) must be surrounded
by quotes. Sometimes the string may be a keyword to the FIND command, in
which case it needs to be quoted (for example, FIND ‘NEXT’ or FIND
‘FIRST’ ALL).

    One FIND option many people are not familiar with is the picture string. Here
is a list of the types of picture strings and their explanation:

=   any character                         .    invalid characters
@   alphabetic characters                 -    non-numeric characters
#   numeric characters                    <    lower case alphabetics
$   special characters                    >    upper case alphabetics
¬   non-blank characters

Picture strings are called using the letter P followed by the quoted character. For
example, FIND P’.’.

    Strings are located regardless of case. The following are the same:

    1. F TEXT
    2. FIND Text
    3. f teXt

   If you need to find the exact match, including case, use the letter C as a prefix
or suffix to the quoted string, e. g. F c’Text’.

   Finds are restricted by columns or labels. For example, F JUNK .HERE
.THERE finds the first occurrence of JUNK beginning at the label .HERE. If
there is no such text between the labels, the message JUNK NOT FOUND is
displayed, even if that text exists outside the labels. See the example on the
next page.

   If you get the “But I can see it, it’s right there!” feeling when doing a FIND,
check the bounds to make sure Edit is actually looking everywhere.
26


                      The FIND Command continued

    In this example a left boundary is set at column 12 and a right boundary is set
at column 60. The F DBD command with the default bounds would find the DBD
in DBDLIB on line 3. Since FIND observes boundaries, the first one found is the
DBD on line 4 (highlighted on the screen, in bold here).
Command ===> f DBD                                            Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 /* REXX IMS Database DDname retriever */
=BNDS>             <                                              >
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000002 /**************************************/
000003 Arg DBDLIB
000004 If DBDLIB = "" Then Do /* Assume DBD is gotten from IMS table */
000005    Address ISPEXEC "VGET (BDBDLIB) SHARED"



   Other parameters FIND can use are CHARS, PREFIX, SUFFIX, and WORD.
Using those, and assuming this line:

DO     DONT     ADO      ADOPT      'DO'      $ADO     (DONT)       ADO-

FIND   DO   CHARS     finds all these words;
FIND   DO   PREFIX    finds only DONT and (DONT);
FIND   DO   SUFFIX    finds only ADO, $ADO, and ADO-;
FIND   DO   WORD      finds only DO and ‘DO’.

  FIND operands may be entered in any order; for example, FIND ALL X DOG
and F DOG X ALL are the same.
27


                          The CHANGE Command

    The CHANGE command has the same operands, working the same way, as
the FIND command. Refer to the FIND command description for more
information on CHANGE.

   All picture strings can be used as the FROM operand in a CHANGE
command. Only the ‘=’, ‘>’, or ‘<’ characters may be used in the TO operand.
This suggests the following: to change all lower-case characters in a dataset to
uppercase, use the command c p'<' p'>' (might be a good idea to set up a
function key for that…).

   FROM strings are located regardless of case. The following are equivalent:

   1. C TEXT DOC
   2. C Text DOC
   3. C teXt DOC

   If you need to make an exact match, including case, you can use the letter C
as a prefix or suffix to the quoted string, e. g. c c’Text’ Doc all.

  However, the TO operand will be passed as-is. The following are NOT the
same:

   1. C TEXT DOC
   2. C TEXT Doc
   3. C TEXT doc

  As with FIND, CHANGE operands may be entered in any order. There is only
one exception: the FROM and TO fields must remain in that order. In other
words the FROM operand must always be immediately followed by the TO
operand.
28


                                    Highlighting

   Highlighting is an excellent way of checking your code (REXX, JCL, COBOL
etc.). HILITE is not a true command parser and sometimes gives strange results,
but it can be useful to identify what may be wrong with a given line of code.

   HILITE ON turns on highlighting without logic checks (i. e. IF/THEN or
DO/END). HILITE LOGIC turns on logic highlighting only. You can specify
IFLOGIC or DOLOGIC to highlight only IF or DO logic.

   HILITE AUTO lets ISPF determine, based on the file type, what keywords or
characters are highlighted. You can specify the language ISPF is to use (e. g.
HILITE COBOL). Valid HILITE languages are:

AUTO      ASM   C        COBOL     DTL         IDL     JCL     PANEL
PASCAL    PLI   OTHER    REXX      BOOK        SKEL    DEFAULT

OTHER is similar to PLI but with only the most basic logic and command
structure. DEFAULT is used when HILITE AUTO is typed but the language
cannot be determined. CNTL is JCL and EXEC is REXX.

   Other HILITE options are:

   1.   HILITE PAREN toggles the highlighting of mismatched parentheses;
   2.   HILITE FIND          toggles the highlighting of the FIND command;
   3.   HILITE CURSOR toggles the highlighting of the current cursor word;
   4.   HILITE SEARCH highlights the first unmatched END, ELSE, }, or )
        between the first line of the dataset and the line the cursor is on. This is
        most useful when you’re on the last line of the dataset.

   Entering HILITE with no operands displays a panel to set up the highlighting
coloring options.
29


                       External Data Commands:
                 Create, Replace, Copy, Move, and Model

   The external data commands are alike in two ways:

   •   they require line references (using C/CC, M/MM, B, A, etc.);
   •   they can be used with dataset names, members, or no operands.

If a member name is specified it must be in the PDS being edited. If no member
name or dataset name is provided, a screen is displayed to enter a source or
destination dataset.

  Rather than scrolling around to find a place to put the data on a COPY or
MODEL, you can specify AFTER or BEFORE and a label. Labels can be used to
mark the data rather than using line commands.

   The line commands are described in more detail in the next section. For
external data commands, you need to know only Copy (C/CC), Move (M/MM),
Before (B) or After (A).

   Remember .ZF and .ZL? You can use those labels to copy or move the
entire contents of the dataset instead of entering C/M99999 on the first line label.

                              Create and Replace

   CREATE makes a new member or dataset from within the current edit
session. These can be either copies using the C/CC line commands, moves
using the M/MM commands, or a range using labels. When lines are moved they
are deleted from the current dataset as if you’d deleted them manually.

   If the destination member or dataset exists, CREATE fails. You can replace
the destination using the REPLACE command, which works exactly as the
CREATE command does.

  To create a member in the current PDS, type the member name. To create a
new dataset, type the DSN after the CREATE command. Some examples:

   •   CREATE opens a screen to enter a member name or dataset to create;
   •   CREATE JUNK creates a member in the current PDS called JUNK;
   •   CREATE JUNK .ZF .ZL copies all lines into the member JUNK;
   •   CREATE MYJCL.EXTRACT creates a sequential file called
       <yourid>.MYJCL.EXTRACT;
   •   CREATE JUNK .HERE .THERE creates the member JUNK using only the
       data delimited by the two labels. The lines are not deleted.
30


               External Data Commands: Copy and Move

   COPY inserts one or more lines from another dataset into the current edit
session. Use the A or B line commands, or the AFTER or BEFORE keywords
with a label, to tell Edit where to put the new lines.

    You are not required to copy the entire dataset when using COPY. You can
choose which lines to copy from the source file. Simply type the start and end
line from within the source file as part of the copy command.

   As with CREATE/REPLACE, if you don’t type a file name on the command,
you are shown a screen to enter the information the command needs. At the
bottom is the place to enter the line numbers. Be careful here. Since it will let
you use line numbers if the dataset has them (e. g. COBOL or JCL), you must
type an “R” in the “Number Type” field (for relative record numbers) or the copy
command may not do what you want.

   If the MOVE command is used, once the data from the source file is copied in,
the source file or member is deleted.

   Some examples of COPY/MOVE commands are below.

   •   COPY opens a screen to enter a member name or dataset to copy in;
   •   COPY JUNK copies in the member JUNK from the current PDS;
   •   MOVE JUNK copies the data from the member JUNK and deletes it;
   •   COPY MYJCL.EXTRACT AFTER .HERE locates the label .HERE and
       copies the entire contents of MYJCL.EXTRACT following that line;
   •   MOVE MYJCL.EXTRACT 1 6 BEFORE .ZF copies lines 1 through 6 of
       MYJCL.EXTRACT into the current edit session as the first six lines of the
       file, then deletes MYJCL.EXTRACT.
31


                                 Cut and Paste

    Edit provides CUT and PASTE commands similar to the PC cut and paste
commands. ISPF provides a default clipboard to hold data items cut. The syntax
for CUT is essentially the same as that for CREATE; the syntax for PASTE is
essentially the same as that for COPY.

   The following operands apply to CUT:

   •   REPLACE replaces the contents of the clipboard;
   •   APPEND adds the cut text to the bottom of whatever is on the clipboard;
   •   DISPLAY shows what’s on the clipboard. Other operands are ignored.

   The following operands apply to PASTE:

   •   DELETE clears the clipboard contents;
   •   KEEP keeps the clipboard as-is.

   Use the EDITSET command to set up cut and paste.


                              A Word on Models

   ISPF provides skeletal models of many different types of data. You can call in
a model of a dialog function (e. g. panel, skeleton, or table define), a program (e.
g. COBOL, REXX exec), or function call (e. g. VPUT).

    Most people do not use models because it’s simpler to copy in a similar piece
of data and modify it to suit. The ISPF models are generic, and useful if you’ve
forgotten the syntax of some command.

    To call in a model use the MODEL command. Provide the name of the model
(and its sub-name, if needed), and tell ISPF where to put it using either A or B
line commands or labels (a la COPY).
32


                             Edit Line Commands

    Edit line commands are entered on the line labels to the left of the data
section. Many line commands act with primary commands. Line commands fall
into seven families:

   •   Basic commands (e. g. insert);
   •   Move/Copy commands;
   •   Shifting commands (e. g. shift left);
   •   Exclude/Show commands;
   •   Text handling commands (e. g. text splitting);
   •   Data command (MD);
   •   Miscellaneous commands.

If you have created your own labels it’s OK to type line commands over them.
Your labels will not be removed by doing so; the primary command RESET
LABELS is needed to do that.

   Line commands can take one of three forms:

   1. a single character referring to a single line;
   2. the command followed by a number refers to the number of lines, starting
      at the line the command is on. For example, D3 deletes three lines;
   3. the character entered twice indicates a block is to be handled. For
      example, the CC command begins or ends a block copy operation.

   As many line commands as desired can be entered as a single operation as
long as they don’t interfere with each other.

                                    A Caveat

    The editor uses a combination of blanks and cursor location to decide what
the number entered should be. Trailing blanks are ignored, as are any numbers
or letters following the cursor position in the label field. A common problem is to
type a number corresponding to the line number. Say, when shifting right 1 byte,
you type “))1” on line 001200, resulting in “))1200". If the cursor is moved
away before ENTER is hit it appears as if the line numbers were not changed.
The result ends up being the same as if “))” were hit, so the numbers are shifted
two bytes rather than one. To avoid that, type a blank after the 1, as “))1 00”.
33


                     Basic Line Commands: I, D, and R

    The “I” command inserts lines, the “D” command deletes lines, and the “R”
command repeats lines. These three commands provide the most basic edit
functions. The D and R commands may be blocked (DD and RR respectively).
All three commands may be followed by numbers to insert, delete or repeat that
many lines.


                          Copy and Move commands

    The “C” command copies, and the “M” command moves, lines within an edit
session. Both may be blocked using CC and MM respectively. Both commands
require the use of the “A” and “B” line commands to determine where the copied
or moved lines are to be placed. A number can follow “A” or “B” commands to
indicate how many times the line or lines are to be copied or moved. For
example, this takes the first line and copies it twice after the fourth line
(commands in bold).
******   ***************************** Top of Data ******************************
C 0001   /* REXX COPYOVER coded December 2001                                  */
000002   /**********************************************************************/
000003   /*      Do an ISPF EDIT-like copy with overlay when there are many    */
A2 004   /* alternating lines of data. Saves wear and tear on the carpal       */


    Both the copy and move commands can be used to overlay other lines. The
“O” line command indicates where to overlay. “O” can also be blocked (OO). In
this example the third line will overlay the fourth as a move.
******   ***************************** Top of Data ******************************
000001   /* REXX COPYOVER coded December 2001                                  */
000002   /**********************************************************************/
m 0003   /*                                                                    */
o 0004           Do an ISPF EDIT-like copy with overlay when there are many
000004   /* alternating lines of data. Saves wear and tear on the carpal       */


   As a block overlay, do this.
******   ***************************** Top of Data ******************************
000001   /* REXX COPYOVER coded December 2001                                  */
000002   /**********************************************************************/
m 0003   /*                                                                    */
oo 004           Do an ISPF EDIT-like copy with overlay when there are many
oo 004      alternating lines of data. Saves wear and tear on the carpal
34


                         Edit Line Commands: Shifting

   Two kinds of data shifting are provided: column shifting and data shifting.
The column shift characters are parentheses; data shift characters are the angle
brackets (greater than or less than signs). Data shifting is used on indented
code.


                                     Column Shifting

    Column shifting moves data left or right the specified number of columns. The
default movement is two columns. A single parenthesis shifts a single line;
double parentheses shift a block of lines. Bounds are observed as left or right
limits.
=BNDS>               <                                                 >
)5 300       DATA1   DATA2   DATA3     ('    ')    DATA4     DATA5


results in
=BNDS>               <                                                >
000300       DATA1        DATA2   DATA3     ('     ')   DATA4     DATA5


The text DATA1 has not moved since it’s out of the boundaries.

   The editor does not consider loss of data an error on shifting. Here’s the
result of the shift if we shifted ten columns instead of five.
=BNDS>               <                                                 >
000300       DATA1             DATA2     DATA3    ('    ')     DATA4


The text DATA5 has vanished since it’s been shifted beyond the LRECL limits.

   This feature is useful to mass delete data. Set an appropriate left or right
bound, then shift characters in that direction using a number larger than the
number of characters.
35


                     Data Shift Line Commands: Data Shifting

    Data shifting moves data left or right the specified number of columns, but the
logic is different. Data shifting takes the first non-blank field after the first blank
and shifts it to a) accommodate the shift request and b) remove blanks from the
line.

    The default movement is two columns. A single angle bracket moves a single
line; double angle brackets shift a block of lines. Bounds are observed as left or
right limits.
=BNDS>                <                                               >
>5 300       DATA1    DATA2   DATA3   ('      ')     DATA4    DATA5


results in
=BNDS>                <                                               >
000300       DATA1    DATA2        DATA3 ('        ') DATA4   DATA5


DATA1 is not shifted because it is outside the current bounds. DATA2 is not
shifted because it starts in the left column. DATA3 is shifted five columns as
requested by >5. ('          ') is shifted but the blanks inside are unchanged.
DATA5 does not require shifting and is left unchanged.

   What happens when the requested movement is too large? In a column shift
data is lost. When data shifting data is not lost; shifting is changed to match that
requirement. If we shifted ten characters instead of five, this happens.
=BNDS>                <                                            >
=ERR=>       DATA1    DATA2           DATA3 ('        ') DATA4 DATA5


DATA3 is shifted as far as it can be shifted without:

   •     losing data,
   •     shifting data beyond the right bound,
   •     deleting single blanks,
   •     deleting blanks within apostrophes.

The line is marked with an error flag since shifting was not completed as
requested.
36


            Edit Line Commands: Exclude and Show Lines

   We’ve talked about excluding lines using the EXCLUDE primary command,
and how the RESET command reshows excluded lines. The line commands X,
S, F, and L provide better control over this process.

   The “X” command excludes one or more lines based on a number. For
example, X3 excludes the current line and the following two lines. You can
exclude a block of lines using “XX”.

   The “F” and “L” commands show the first and last lines of the excluded block
respectively. While they cannot be blocked, you can provide a number. For
example, F5 unexcludes the first five lines of the excluded block. If the number
requested is larger than the number of excluded lines, all lines are unexcluded.

   The “S” command shows the “most significant line(s)” of the excluded block.
Significance is determined by the amount of indenting. If all lines requested by
the “S” command are equally indented, the first lines are shown.
37


                      Edit Line Commands: Text Handling

   There are five text-handling commands: TS (text split), TF (text flow), TE (text
enter), LC (lower case), and UC (upper case).


                                          Case

    The two text line commands dealing with case are LC (lower case) and UC
(upper case). LC converts all characters on the line to lower case; UC converts
all characters on the line to upper case.


                                     Text Split

   Let’s say we have these two lines (the – is the cursor).
ts 400            This line will be split in two to allow insertions
000500         into the text.                    -


The result is:
000400            This line will be split in two
''''''
000410         to allow insertions
000500         into the text.


Each time a text split occurs, a blank insert line appears between the results of
the split. That allows more typing and less use of the TS line command. If you
want more than one line, add a number on the end of the TS command.

   As with many commands, bounds are observed. That allows print column-
type processing, e. g. from this.
=BNDS> <                              >
ts 400 This is text data on the             This is text data on the
000500 left side.       -                   right side.


to this:
=BNDS>     <                          >
000400     This is text data                This is text data on the
''''''                      -
000410     on the
000500     left side.                       right side.
38


             Edit Line Commands: Text Handling continued:

                                    Text Flow

    Text flow combines sentences into a more-or-less clean paragraph. The flow
is stopped at a blank line, or at indentations. Let’s say we have these three lines:
tf 400          These lines illustrate the text flow command, in
000500       which text is connected to other text
000600       on other lines to make paragraphs.


The result is:
000400          These lines illustrate the text flow command, in which text is
000500       connected to other text on other lines to make paragraphs.


   Flowed words are connected by a single blank. Periods are followed by two
blanks. Extra blanks embedded in a line are not compressed out.

  Using a number with TF indicates the width of the text being flowed. In the
above example, if we used TF40 instead of TF the result is:

000400          These lines illustrate the text flow
000500       command, in which text is connected to
000600       other text on other lines to make
000700       paragraphs.




                                    Text Entry

    The TE line command formats the edit session to emulate a word processor
to allow power typing. In this mode, line labels are not displayed and your typing
remains only in the editor’s data window. When you’ve finished typing, your new
text is flowed together as if you entered the TF command. Here’s an example:
te 400           following this line.
              The text entry command formats the display so that entr
         y of text can be made without regard to end of line consider
         ations.


When ENTER is hit, the result is:
000400        following this line.
000410      The text entry command formats the display so that
000420 entry of text can be made without regard to end of line
000430 considerations.
39


                       Miscellaneous Line Commands

   Three line commands are used in conjunction with your profile and primary
commands: BNDS, MASK, and TABS. A fourth line command, COLS, is used
as a reference.

   COLS displays a column reference.

000008 //SYSIN    DD *
=COLS> ----+----1----+----2----+--
000009 LIST.DB DBD(DPH01MD6) DBDS


The COLS line cannot be overtyped. It can be removed using the RESET
primary or D line command.

  BNDS displays a line describing the current boundaries. The left bound is
marked by a left angle bracket (<), the right bound by a right angle bracket (>).
000400 //STEP01    EXEC PGM=DSPURX00
=BNDS> <                                                                              >
000500 //STEPLIB   DD DSN=IMSVS.GRUP.IMS.RESLIB,DISP=SHR


   Bounds are changed by changing the location of either or both bound
markers. The BNDS line can be removed using the RESET primary or D line
command. However, removing the BNDS line does not change the current
bounds. The primary command BOUNDS with no operands resets bounds to the
default value.

   The TABS and MASK line commands were discussed under Edit Profiles.

   Performance note: in a large dataset, deleting individual TABS, MASK, BNDS, or
COLS lines is more efficient than the RESET command because all lines are processed
under RESET.



                       The MakeData Line Command

   The MakeData (MD) line command takes some temporary lines (e. g. COLS
or NOTE) and converts each line to a data line. MD works on a single line; MDD
or MDMD marks blocks of lines to convert to data. To mark the next “X” lines,
use MD followed by the number of lines to make into data. MD does not convert
the following lines to data: PROF, BNDS, TABS, MASK.
40


                          Not Your Father’s Editor

   The ISPF editor is a very powerful tool. In addition to having a great many
useful functions, you can build your own in the form of edit macros. This course
does not go into detail on how to write edit macros; the advanced ISPF courses
do that. I will show you a few macros and explain them as I go; you can then
write your own to string many commands together.

    On the main edit panel, there are a number of fields besides the dataset name
entry fields. I never use them unless I absolutely have to for a particular task, but
I do want to point out the Initial Macro field.

   It is possible to start your edit session with a string of commands. For
example, you may hate those warning messages that come up every time
(“WARNING: the UNDO command will not be available…”). Or, in a PDS, you
always turn STATS on. A macro written to start an edit session is called an initial
macro.

  You can specify an initial macro on the EDIT screen, but there is another way.
Once you’ve got an edit macro built you can set it “forever” by:

   1. ZUSERMAC = 'DFOIMAC' sets the initial edit macro variable to the name
      of your initial edit macro (mine is DFOIMAC);
   2. The ISPEXEC command 'VPUT ZUSERMAC PROFILE' puts the variable
      into the profile pool so it is always executed.

To clear the edit macro use this ISPEXEC command: 'VERASE ZUSERMAC
PROFILE'. You must use VERASE because directly editing your ISPF profile
could cause problems.

   Here is a copy of my initial edit macro, with comments:
/* REXX */
Address ISREDIT
"MACRO"
"PROFILE UNLOCK"                    Unlock the edit profile.
"BOUNDS"                            Reset bounds in case I forgot before.
"NULLS ON"                          Nulls on for freedom of inserting.
"HILITE AUTO"                       HILITE based on file type.
"RECOVERY ON"                       Allow recovery.
"AUTOSAVE ON"                       Save when F3 is pushed.
CURMBR = ""
"(CURMBR) = MEMBER"                 Is this a PDS member?
If CURMBR <> "" Then “STATS ON”     If so, turn on STATS.
"RESET"                             Get rid of all messages.
Exit
41


                          A Few Good Edit Macros

   •   ALLLC       convert all characters to lower case.
   •   ALLUC       convert all characters to upper case.
   •   CHKPARM     copy the selected SYSIN parm as comments into the JCL.
   •   COMMOUT     comment out a section of JCL.
   •   DELDUPS     delete duplicate records from dataset.
   •   DSU         browse, edit, view, delete, or allocate dataset the cursor is on.
   •   HIDE        exclude only those lines containing a string.
   •   CENTER      center text on a line or group of lines.
   •   PUTPARM     copy the selected parm contents to a dataset.
   •   SEEK        undo a HIDE command.
   •   XFS         exclude all and find a single string, parms allowed.


                         Coding Simple Edit Macros

   Coding a simple macro is, well, simple. There are three things to remember.

   1. The first statement must be ISREDIT MACRO.
   2. Arguments are listed in parenthesis after the MACRO statement. Initial
      edit macros cannot have arguments.
   3. You may have an END or CANCEL command in your macro as long as
      it’s the last statement.

    Item 3 is important. You can code an edit macro to make a set of changes to
a file, then exit, without ever seeing an edit session. Suppose you have JCL
created in a generic PDS with the job name coded as “??????T”. You can code
an initial edit macro to change that to your user ID, submit the job, and then
cancel out of it without saving the changes. Here’s an edit macro to do that.
/* REXX IEDMAC */
Address ISREDIT                   Pass all commands to the editor
"MACRO"
"CHANGE ??????" Sysvar(SYSUID)    Change the job name
"SUBMIT"                          Submit the job
"CANCEL"                          Get out without saving
Exit


   The call to invoke the macro looks like this:

       ISPEXEC EDIT DATASET(dsn(member)) MACRO(IEDMAC)

The call must be in a REXX exec or CLIST; it cannot be executed in TSO. This
lets an area create a set of generic JCL to be submitted using commands.
42


       “All Together Now:” Full Examples of an Edit Session

    Let’s bring together some of the concepts we’ve learned about Edit. On the
following pages are some examples using the many commands and concepts
we’ve learned to do some actually useful things.

    On this and the next page are some steps we might do to create and run a set
of JCL. Here’s an empty member of my JCL PDS after I’ve displayed my profile
and run some commands:
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
=PROF> ....CNTL (FIXED – 80)....RECOVERY OFF WARN....NUMBER ON STD.............
=PROF> ....CAPS ON....HEX OFF....NULLS ON STD....TABS ON STD...................
=PROF> ....AUTOSAVE ON....AUTONUM OFF....AUTOLIST OFF....STATS ON..............
=PROF> ....PROFILE UNLOCK....IMACRO NONE....PACK OFF....NOTE ON................
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7—
=TABS>           *
=MASK> //          DD DISP=SHR,DSN=
=BNDS> <                                                                       >
****** **************************** Bottom of Data ****************************


   Here are the commands I entered and why I chose them:

   1. PROFILE 8 displayed the profile for this PDS, including the TABS, MASK,
      and BOUNDS lines;
   2. TABS ON turns on tab capability;
   3. NULLS ON allows me to insert anywhere;
   4. NUMBER ON STD provides JCL numbers in columns 73-80;
   5. Entered a hardware tab in column 12 (for the DD);
   6. Created a mask for “//”, “DD”, and DISP fields, since those are the most
      common things I use.

Notice the BOUNDS are set at 1 and 72. The editor did that because columns
73 – 80 are the line numbers. That makes the line numbers exempt from
commands like FIND and CHANGE.
43


                      Edit Session Example continued

   Now I enter the RESET command and insert 10 lines:
******   ***************************** Top of Data ******************************
''''''   //         DD DISP=SHR,DSN=
''''''   //         DD DISP=SHR,DSN=
''''''   //         DD DISP=SHR,DSN=
''''''   //         DD DISP=SHR,DSN=
''''''   //         DD DISP=SHR,DSN=
''''''   //         DD DISP=SHR,DSN=
''''''   //         DD DISP=SHR,DSN=
''''''   //         DD DISP=SHR,DSN=
''''''   //         DD DISP=SHR,DSN=
''''''   //         DD DISP=SHR,DSN=
******   **************************** Bottom of Data ****************************


   Notice how the mask is propagated? I’ll enter some data, using the tabs and
my keyboard’s END key (I set that as end of field) when needed. This is the
screen after I’ve typed but before I’ve hit ENTER:
******   ***************************** Top of Data ******************************
''''''   //SP1002ST JOB SP218ZZDFO9999A044,'ODEA 77184',USER=@TSSQ04,
''''''   //       MSGLEVEL=1,MSGCLASS=H,PRTY=4,NOTIFY=@TSSQ04
''''''   //*FORMAT PR,DDNAME=,DEST=TMNODE1.RM005
''''''   //*MAIN CLASS=TSS04
''''''   //**
''''''   //STEP01    EXEC PGM=IEFBR14
''''''   //dd01      DD DSN=@tssq04.junk.data,disp=(mod,delete),
''''''   //          unit=d,space=(trk,0)
''''''   //          DD DISP=SHR,DSN=
''''''   //          DD DISP=SHR,DSN=
******   **************************** Bottom of Data ****************************


  See how I’ve been able to overlay the mask wherever needed? Here’s the
same screen after I hit ENTER:
******   ***************************** Top of Data ******************************
000100   //SP1002ST JOB SP218ZZDFO9999A044,'ODEA 77184',USER=@TSSQ04,
000200   //       MSGLEVEL=1,MSGCLASS=H,PRTY=4,NOTIFY=@TSSQ04
000300   //*FORMAT PR,DDNAME=,DEST=TMNODE1.RM005
000400   //*MAIN CLASS=TSS04
000500   //**
000600   //STEP01    EXEC PGM=IEFBR14
000700   //DD01      DD DSN=@TSSQ04.JUNK.DATA,DISP=(MOD,DELETE),
000800   //          UNIT=D,SPACE=(TRK,0)
******   **************************** Bottom of Data ****************************


    Now we’ll go ahead and submit the job. Since I’ve set up my F12 key as
submit;end;tso ej;st I can just hit F12 and I’m off and running. Otherwise I’d have
to type SUBMIT, and then hit F3, and then type TSO EJ, and then type ST.
Nineteen keys, or one key… you decide.
44


                             HILITE: an Example

   Now let’s check out some primary and line commands. Here’s a short REXX
exec to illustrate the HILITE command.
******   ***************************** Top of Data ******************************
000001   /* REXX QUIP program */
000003   "ALLOC DDNAME(QUIP) DA('DBIG.QUIPS.DATA') SHR REUSE"
000004   QNUM = RANDOM(1,747)
000005   "EXECIO 1 DISKR QUIP" QNUM "(FINIS"
000006   PARSE PULL QUIP; SAY QUIP
000007   "FREE F(QUIP)"
******   **************************** Bottom of Data ****************************


   In the example bold characters are quoted text (white in Edit), italics are
comments (cyan), and underlined characters are “keywords” (red), used for
highlighting logic, language verbs, and so on. You can see how this might be
useful. Notice on Line 4 the “QNUM” variable is not in the quotes and is not
highlighted. If QNUM were supposed to be part of the command and not a
variable you would expect it to be highlighted as is the rest of the command.

   Let’s change this a bit. I’ll drop the “*/” from the comment and remove one of
the quotes. Let’s see what happens.
******   ***************************** Top of Data ******************************
000001   /* REXX QUIP program
000003   "ALLOC DDNAME(QUIP) DA('DBIG.QUIPS.DATA') SHR REUSE
000004   QNUM = RANDOM(1,747)
000005   "EXECIO 1 DISKR QUIP" QNUM "(FINIS"
000006   PARSE PULL QUIP; SAY QUIP
000007   "FREE F(QUIP)"
******   **************************** Bottom of Data ****************************


   Not what we expected, is it? Without the closing “*/” Rexx thinks the entire
code is a comment. Highlighting is smart enough to catch this. Let’s put the “*/”
back (but leave the quotes off) and see what happens.
******   ***************************** Top of Data ******************************
000001   /* REXX QUIP program */
000003   "ALLOC DDNAME(QUIP) DA('DBIG.QUIPS.DATA') SHR REUSE
000004   QNUM = RANDOM(1,747)
000005   "EXECIO 1 DISKR QUIP" QNUM "(FINIS"
000006   PARSE PULL QUIP; SAY QUIP
000007   "FREE F(QUIP)"
******   **************************** Bottom of Data ****************************


   All the red is gone. The strings are quoted, so they’re no longer considered
REXX verbs. Note the left parenthesis next to “FINIS”; it’s pink! Highlighting is
expecting a matching right parenthesis because the left parenthesis is no longer
quoted. Unmatched parentheses are an error, so this one is highlighted even
though it’s perfectly legal in REXX.
45


                        Sort, Exclude, and Bounds

    We talked separately about using the SORT command, excluding lines, and
setting bounds. Let’s combine those concepts. Here’s a dataset with information
in columns:
Command ===>                                                   Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 NAME           HR     NAME           HR     NAME            HR
000002 BONDS          49     HELTON         46     SOSA            51
000003 HELTON         46     SOSA           51     PALMIERO        48
000004 THOME          52     PALMIERO       48     GARCIAPARRA     30
000005
000006 NAME           HR     NAME           HR     NAME            HR
000007 THOMAS         26     BAGWELL        34     KONERKO         38
000008 THOMAS         26     BURNITZ        38     BAGWELL         34
000009 BURNITZ        32     KONERKO        38     KOSKIE          16
****** **************************** Bottom of Data ****************************



   Suppose we want to sort all three columns into HR order. There’s no obvious
way to do this and still preserve the separate order each column deserves.
Using “sort 16 17 a 38 39 a 60 61 a” results in:

Command ===>                                                   Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001
000002 NAME           HR     NAME           HR     NAME            HR
000003 NAME           HR     NAME           HR     NAME            HR
000004 THOMAS         26     BAGWELL        34     KONERKO         38
000005 THOMAS         26     BURNITZ        38     BAGWELL         34
000006 BURNITZ        32     KONERKO        38     KOSKIE          16
000007 HELTON         46     SOSA           51     PALMIERO        48
000008 BONDS          49     HELTON         46     SOSA            51
000009 THOME          52     PALMIERO       48     GARCIAPARRA     30
****** **************************** Bottom of Data ****************************



   We know that’s not right. The header and spacer lines have percolated to the
top and we’ve lost our data integrity. What can we do? Somehow we have to
ignore the lines we don’t want to sort.
46


                   Sort, Exclude and Bounds continued

   Let’s take the original data and apply the exclude line command (“X”) to mark
those lines we want sorted:
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 NAME           HR     NAME           HR     NAME           HR
- - - - - - - - - - - - - - - - - - - 3 Line(s) not Displayed
000005
000006 NAME           HR     NAME           HR     NAME           HR
- - - - - - - - - - - - - - - - - - - 3 Line(s) not Displayed
****** **************************** Bottom of Data ****************************


  Now we’ll try the same sort, this time using the “X” operand on the SORT,
making the command sort x 16 17 a 38 39 a 60 61 a:

Command ===>                                                   Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 NAME           HR     NAME           HR     NAME            HR
000002 THOMAS         26     BAGWELL        34     KONERKO         38
000003 THOMAS         26     BURNITZ        38     BAGWELL         34
000004 BURNITZ        32     KONERKO        38     KOSKIE          16
000005
000006 NAME           HR     NAME           HR     NAME            HR
000007 HELTON         46     SOSA           51     PALMIERO        48
000008 BONDS          49     HELTON         46     SOSA            51
000009 THOME          52     PALMIERO       48     GARCIAPARRA     30
****** **************************** Bottom of Data ****************************



   As Bullwinkle said, “Well, I’m getting close,” but it’s not good enough. Players
have switched teams and still only the first column is close to the proper order.
How do we do this?

   An obvious solution is to “X” out those lines we want sorted, a section at a
time, and then sort only that section. The result of that is:
Command ===>                                                   Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 NAME           HR     NAME           HR     NAME            HR
000002 HELTON         46     SOSA           51     PALMIERO        48
000003 BONDS          49     HELTON         46     SOSA            51
000004 THOME          52     PALMIERO       48     GARCIAPARRA     30
000005
000006 NAME           HR     NAME           HR     NAME            HR
000007 THOMAS         26     BAGWELL        34     KONERKO         38
000008 THOMAS         26     BURNITZ        38     BAGWELL         34
000009 BURNITZ        32     KONERKO        38     KOSKIE          16
****** **************************** Bottom of Data ****************************


   Much better, but still not right. While players haven’t switched teams and the
headers are still there, the sort order is still wrong.
47


                    Sort, Exclude and Bounds continued

   The first thought is to split the sort into three sorts. The result is still going to
be records not in sort order because, no matter what, the highest-order sort
controls the record order. Does this have to be done manually? Not at all!

    What we have here, after line exclusion and sorting all the fields at once, is a
file with the left-most of three columns in the correct order. Using bounds in
conjunction with exclusion and sorting will accomplish what we want.

   Remember, SORT works within boundaries only. Here again is our data,
sorted after using exclude and sort (sort x 16 17 a) so the first column is
correct. This time I’ve included a BNDS line command to limit the next sort to the
center column:
Command ===>                                                   Scroll ===> CSR
****** ***************************** Top of Data ******************************
=BNDS>                      <                  >
000001 NAME           HR      NAME          HR     NAME            HR
000002 HELTON         46      SOSA          51     PALMIERO        48
000003 BONDS          49      HELTON        46     SOSA            51
000004 THOME          52      PALMIERO      48     GARCIAPARRA     30
000005
000006 NAME           HR      NAME          HR     NAME            HR
000007 THOMAS         26      BAGWELL       34     KONERKO         38
000008 THOMAS         26      BURNITZ       38     BAGWELL         34
000009 BURNITZ        32      KONERKO       38     KOSKIE          16
****** **************************** Bottom of Data ****************************


   Now we’ll re-exclude the lines and sort as we did the first time (hopefully you
remember to use the RETRIEVE key), the command being sort x 38 39 a.
The result of this second sort is:
Command ===>                                                   Scroll ===> CSR
****** ***************************** Top of Data ******************************
=BNDS>                      <                  >
000001 NAME           HR      NAME          HR     NAME            HR
000002 HELTON         46      HELTON        46     PALMIERO        48
000003 BONDS          49      PALMIERO      48     SOSA            51
000004 THOME          52      SOSA          51     GARCIAPARRA     30
000005
000006 NAME           HR      NAME          HR     NAME            HR
000007 THOMAS         26      BAGWELL       34     KONERKO         38
000008 THOMAS         26      BURNITZ       38     BAGWELL         34
000009 BURNITZ        32      KONERKO       38     KOSKIE          16
****** **************************** Bottom of Data ****************************


   We’ll now repeat the same procedure sorting on columns 60 and 61. The
result is on the next page.
48


                   Sort, Exclude, and Bounds continued

   Here’s the result:
Command ===>                                                    Scroll ===> CSR
****** ***************************** Top of Data ******************************
=BNDS>                                            <                    >
000001 NAME           HR     NAME           HR      NAME            HR
000002 HELTON         46     HELTON         46      GARCIAPARRA     30
000003 BONDS          49     PALMIERO       48      PALMIERO        48
000004 THOME          52     SOSA           51      SOSA            51
000005
000006 NAME           HR     NAME           HR      NAME            HR
000007 THOMAS         26     BAGWELL        34      KOSKIE          16
000008 THOMAS         26     BURNITZ        38      BAGWELL         34
000009 BURNITZ        32     KONERKO        38      KONERKO         38
****** **************************** Bottom of Data ****************************


   In order, the steps to follow are:

   1.   Determine your sort fields;
   2.   Set appropriate bounds using the BNDS line command;
   3.   Exclude the lines you want sorted using the X/XX line command;
   4.   Code your sort command as SORT X <start> <end> a/d;RES X;
   5.   Return to number 2. and continue until you’re done sorting.

If you’re sorting in ascending order with only one field, you can leave off the “a”.
The “;RES X” on the end of the command resets the excluded lines to get ready
for the next exclude line commands. Don’t forget to use the RETRIEVE key to
relieve strain on your carpal tunnel.

   When you’re done with this sort of process, you’ll want to execute the
BOUNDS primary command to reset any bounds you changed back to the
defaults. If you don’t you may end up surprised.
49


                                Miscellaneous Edit Trick

   On a dataset entry field you can limit the PDS member name list to certain
members using wildcards. We talked about them before; here’s a practical
example. To see only those members starting with ACB, on the main Edit screen
you can enter (see bold):
   Menu RefList RefMode Utilities Workstation Help
 ------------------------------------------------------------------------------
                                Edit Entry Panel
 Command ===>

 ISPF Library:
    Project . .   .   @TSSQ04
    Group . . .   .   SN1        . . .            . . .         . . .
    Type . . .    .   CNTL
    Member . .    .   acb*               (Blank or pattern for member selection list)

 Other Partitioned, Sequential or VSAM Data Set:
    Data Set Name . . .
    Volume Serial . . .           (If not cataloged)

 Workstation File:
    File Name . . . . .
                                                Options
 Initial Macro . .      .   .                      Confirm Cancel/Move/Replace
 Profile Name . . .     .   .                      Mixed Mode
 Format Name . . .      .   .                      Edit on Workstation
 Data Set Password      .   .                      Preserve VB record length


  This can be done anywhere you enter a dataset name, including on the
DSLIST panels (see the DSLIST section below).

   The entire member list is always accessible. In the case above you could
select another member to edit, even if its name is not listed on the member list,
as long as the member is in the PDS.
50


                         Miscellaneous ISPF Tricks

    Use member masks to create any member list. Normally you’ll see a list of
members with selection fields to the left, and sometimes a PROMPT field to the
right. In the PROMPT field you can enter parameters to be passed to certain line
commands.

   Member lists can have three types of selection fields:

   1. A single dot indicates only one member can be processed at a time using
      a single command (usually “S”);
   2. A single underscore indicates only one member can be processed at a
      time, using multiple function commands (e. g. “S”, “E”, “R”, etc.);
   3. A line of underscores indicates many members can be processed using
      multiple function commands.

   In member lists with underscores, you can select a list of members to pass
to a line command. The result is as if you entered separate line commands. For
example, to edit all ACB* members in a PDS, use this command:

COMMAND ===> s ACB* e

where “e”, edit, is the command being passed.

    This can also be done in the COPY function (option 3.3). To copy or move
members from one PDS or another you can enter a member name mask. You
may be tempted to type the “S” in each selection field. To reduce strain on your
fingers type “S *” on the command line instead.

   Use the PC’s copy and paste functions to rename members in a PDS. For
example, to rename the ACB* members to ARB* members:
LIBRARY             @TSSQ04.SN1.CNTL                          Row 00001 of 00092
Command ===>                                                    Scroll ===> CSR
   Name      Prompt           Size    Created           Changed            ID
R ACBJCL   ArBJCL               58   2002/09/23   2002/09/23 11:30:37    @TSSQ04
R ACBJCLT ArBJCLT               47   2002/09/23   2002/10/09 09:42:25    @TSSQ04
R ACBSYSIN ArBSYSIN             13   2002/09/23   2002/11/04 15:35:05    @TSSQ04


   For this example I typed “R” next to the members I wanted to rename, copied
the member names, and then pasted them into the PROMPT field. Then I
overtyped the “C” to be “r” and hit ENTER.

  For a few members this works well. If you have many members, though, you
may not want to do things this way. I have a REXX exec designed to rename all
members in a PDS. If you’re interested you can have it.
TSO Productivity
TSO Productivity
TSO Productivity
TSO Productivity

More Related Content

What's hot

Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3
janaki ram
 
Xdc command-to-print-job-output-and-syslog-from-sdsf
Xdc command-to-print-job-output-and-syslog-from-sdsfXdc command-to-print-job-output-and-syslog-from-sdsf
Xdc command-to-print-job-output-and-syslog-from-sdsf
Maintec Technologies Inc.
 

What's hot (20)

Mainframe interview
Mainframe interviewMainframe interview
Mainframe interview
 
JCL SORT TOOL
JCL SORT TOOLJCL SORT TOOL
JCL SORT TOOL
 
DB2 for z/OS Architecture in Nutshell
DB2 for z/OS Architecture in NutshellDB2 for z/OS Architecture in Nutshell
DB2 for z/OS Architecture in Nutshell
 
Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3
 
Z OS IBM Utilities
Z OS IBM UtilitiesZ OS IBM Utilities
Z OS IBM Utilities
 
Mainframe
MainframeMainframe
Mainframe
 
Xdc command-to-print-job-output-and-syslog-from-sdsf
Xdc command-to-print-job-output-and-syslog-from-sdsfXdc command-to-print-job-output-and-syslog-from-sdsf
Xdc command-to-print-job-output-and-syslog-from-sdsf
 
Smpe
SmpeSmpe
Smpe
 
z/OSMF Workflow Editor Lab - Try it out on your z/OSMF system
z/OSMF Workflow Editor Lab - Try it out on your z/OSMF systemz/OSMF Workflow Editor Lab - Try it out on your z/OSMF system
z/OSMF Workflow Editor Lab - Try it out on your z/OSMF system
 
DB2 utilities
DB2 utilitiesDB2 utilities
DB2 utilities
 
JCL MAINFRAMES
JCL MAINFRAMESJCL MAINFRAMES
JCL MAINFRAMES
 
ISPF Recent and Coming Enhancements
ISPF Recent and Coming EnhancementsISPF Recent and Coming Enhancements
ISPF Recent and Coming Enhancements
 
Tso and ispf
Tso and ispfTso and ispf
Tso and ispf
 
ALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARM
 
Top jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsTop jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tips
 
IBM Utilities
IBM UtilitiesIBM Utilities
IBM Utilities
 
Cobol
CobolCobol
Cobol
 
20 DFSORT Tricks For Zos Users - Interview Questions
20 DFSORT Tricks For Zos Users - Interview Questions20 DFSORT Tricks For Zos Users - Interview Questions
20 DFSORT Tricks For Zos Users - Interview Questions
 
JCL DFSORT
JCL DFSORTJCL DFSORT
JCL DFSORT
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
 

Viewers also liked (10)

Advanced REXX Programming Techniques
Advanced REXX Programming TechniquesAdvanced REXX Programming Techniques
Advanced REXX Programming Techniques
 
White Paper, System Z Dataset Naming Standards
White Paper, System Z Dataset Naming StandardsWhite Paper, System Z Dataset Naming Standards
White Paper, System Z Dataset Naming Standards
 
Rexx summary
Rexx summaryRexx summary
Rexx summary
 
Neha Gupta
Neha GuptaNeha Gupta
Neha Gupta
 
White Paper, The Basics Of Data Security
White Paper, The Basics Of Data SecurityWhite Paper, The Basics Of Data Security
White Paper, The Basics Of Data Security
 
Some ISPF Tricks
Some ISPF TricksSome ISPF Tricks
Some ISPF Tricks
 
Basic IMS For Applications
Basic IMS For ApplicationsBasic IMS For Applications
Basic IMS For Applications
 
IMSDB - DBRC
IMSDB - DBRCIMSDB - DBRC
IMSDB - DBRC
 
VSAM Tuning
VSAM TuningVSAM Tuning
VSAM Tuning
 
UVP, Mine
UVP, MineUVP, Mine
UVP, Mine
 

Similar to TSO Productivity

DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03
Linda Hagedorn
 
How to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by IvanHow to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by Ivan
Ivan Silva
 
BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up
Craig Schumann
 
Exceljet excel shortcuts_160623
Exceljet excel shortcuts_160623Exceljet excel shortcuts_160623
Exceljet excel shortcuts_160623
Rishav Singh
 
Top Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To KnowTop Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To Know
Kathy Brown
 
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
IBMSystemzEvents
 

Similar to TSO Productivity (20)

Dfsort application programming guide
Dfsort application programming guideDfsort application programming guide
Dfsort application programming guide
 
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1 ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1
 
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP ProfessionalsERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
 
DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03
 
New204
New204New204
New204
 
How to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by IvanHow to solve misalignment lun netapp on linux servers by Ivan
How to solve misalignment lun netapp on linux servers by Ivan
 
pm1
pm1pm1
pm1
 
Carte tehnica fax imprimanta en MINOLTA
Carte tehnica fax imprimanta en MINOLTACarte tehnica fax imprimanta en MINOLTA
Carte tehnica fax imprimanta en MINOLTA
 
BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up
 
Exceljet excel shortcuts_160623
Exceljet excel shortcuts_160623Exceljet excel shortcuts_160623
Exceljet excel shortcuts_160623
 
JCL ICETOOL
JCL ICETOOLJCL ICETOOL
JCL ICETOOL
 
Toad tipstricksexpertinsight
Toad tipstricksexpertinsightToad tipstricksexpertinsight
Toad tipstricksexpertinsight
 
EC8691-MPMC-PPT.pptx
EC8691-MPMC-PPT.pptxEC8691-MPMC-PPT.pptx
EC8691-MPMC-PPT.pptx
 
Top Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To KnowTop Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To Know
 
3bOS: A flexible and lightweight embedded OS operated using only 3 buttons
3bOS: A flexible and lightweight embedded OS operated using only 3 buttons3bOS: A flexible and lightweight embedded OS operated using only 3 buttons
3bOS: A flexible and lightweight embedded OS operated using only 3 buttons
 
Icetool
IcetoolIcetool
Icetool
 
x86_1.ppt
x86_1.pptx86_1.ppt
x86_1.ppt
 
Introduction to Blackfin BF532 DSP
Introduction to Blackfin BF532 DSPIntroduction to Blackfin BF532 DSP
Introduction to Blackfin BF532 DSP
 
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
 
SP Solutions -Adi.pdf
SP Solutions -Adi.pdfSP Solutions -Adi.pdf
SP Solutions -Adi.pdf
 

Recently uploaded

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

TSO Productivity

  • 1. 1 TSO Productivity: Making your (TSO) life easier By Dan O'Dea Last Update March 23, 2005 ∆ΦΟ
  • 2. 2 Table of Contents Introduction and Goals 3 The ISPF Editor continued Primary Commands continued In The Beginning 4 External Data Commands 28 Starting ISPF. . . . . 4 Create and Replace. . 28 Copy and Move . . . . 29 Setting up ISPF. . . . . 5 Cut and Paste . . . . 30 ISPF settings. . . . . 5 Models. . . . . . . . 30 Log and List settings. 6 Line Commands 31 Stringing Commands . . 8 Insert, Delete, Replace, The ISPF Main Menu . . 9 Copy, and Move. . . . 32 Column Shifting . . . . 33 Getting Around in ISPF . 10 Data Shifting . . . . . 34 The JUMP function. . . 10 Exclude and “Show”. . . 35 The Action Bars. . . . 11 Text Handling 36 ISPF Commands. . . . . 11 Case, Text Split. . . 36 Text Flow and Entry . 37 The ISPF Editor. . . . . 13 Miscellaneous (BNDS, A Word on View . . . . 13 MASK, TABS, COLS) . . 38 Labels . . . . . . . . 14 MakeData (MD) . . . . 38 Line Numbers . . . . . 14 Edit Macros 39 Scrolling. . . . . . . 14 Coding and Example. . . 40 Command Abbreviation . 14 Edit Examples 41 The EDITSET command. . 15 JCL and Masking . . . . 41 Member Lists . . . . . 16 Highlighting. . . . . . 43 Member Selection . . . 17 Sort, Exclude, BNDS . . 44 Edit Profiles. . . . . 17 Edit/Member List Tricks 48 Profile Settings (MASK, Wild Cards. . . . . . . 48 BOUNDS, RECOVERY, Member Masks. . . . . . 49 SETUNDO, NULLS). . . 19 “Many Member” commands. 49 Tabs . . . . . . . . . 20 Copy and Paste. . . . . 49 Primary Commands . . . 21 Delete and Sort. . . 21 DSLIST function . . . . . . 50 Undo, Locate, Reset, Getting a list of files . 50 Flip, and Bounds . . 22 Primary Commands (Find, Submit . . . . . . . 22 Locate, Member, Reset, Profile, Compare, and Sort, SRCHFOR . . . . . 50 Exclude. . . . . . . 24 Line Commands . . . . . . 51 Find . . . . . . . . 26 Cheats 52 Change . . . . . . . 27 Using the “/” and “=” . 52 Hilite . . . . . . . 27 Cut and Paste . . . . . 52 The Final Word . . . . 53
  • 3. 3 Introduction This course is intended for an intermediate to advanced TSO/ISPF audience. It assumes you know what TSO and ISPF are and how to get around in them. It also assumes you have a basic understanding of the ISPF editor and either CLISTs or the REXX language. You will learn about: • Mod-4 and Mod-5 3278 logmodes. • The ISPF SETTINGS set. • The ISPF commands table. • EDIT tools, including edit macros, picture strings, little-used but useful line commands, etc. • Tips and tricks to using ISPF option 3.4, the dataset list. Goals of the Course After this course you should be able to: • Describe and log on using mod2, mod4, and mod5 3278 terminals. • Start ISPF using different options. • Understand ISPF settings. • Set your function keys to use one or more commands. • View ISPF commands tables and read them. • Select multiple PDS members at once. • Use bounds, masks, and tabs effectively. • Use picture strings with FIND and CHANGE. • Use highlighting effectively. • Pass data to and from an edit session. • Exclude and show lines. • Handle text properly. • Write a simple edit macro. • Handle datasets from the DSLIST option. • Use the slash and equals sign in DLIST. Format Note The basic font for this document is Arial 12. TSO commands are given in Courier New 12. Screen prints are shown in Courier New 9, with comments in Arial 10. Sidebars or extra comments are in Times New Roman 12.
  • 4. 4 A Word About Logging On Nearly everyone logs on using the default LTERM of a 3279 model 2. That terminal type displays 24 lines of 80 bytes each. There are other terminal types; two useful ones are 3278-4 and 3278-5. The Model 4 terminal is less familiar to people. I find it useful because it displays 43 lines instead of the usual 24. Seeing more lines in the dataset I’m editing lets me do less scrolling, and I get to see more code when I’m trying to create or modify REXX execs or JCL. To log on using a Mod-4 terminal, on the stag screen type: LOGON APPLID(<TSO ID>) LOGMODE(SNX32704) The Model 5 terminal displays 24 lines of 132 characters, which is useful for displaying sysouts or wide datasets. The logmode to use is SNX32705. “In The Beginning” We do just about all our work in ISPF. It seems a waste of keystrokes to log on and then type ISPF. I start ISPF as part of my first TSO command. Here is a brief example. CLRSCRN TERM NOBREAK /* for file transfers */ ISPF ISPF starts at its main menu by default. That may be all right, but usually you want to start doing something right away. Maybe, most of the time, you want to go right to EDIT. You can start ISPF in any valid menu option. For example, ISPF 3.4 will go first to option 3 (Utilities) of the main menu, then option 4 of the Utilities menu (DSLIST), giving you control at the DSLIST panel. There are other ways to start ISPF, but they deal with creating ISPF commands or Dialog Manager programming. They are discussed later. Dialog Manager is beyond the scope of this course. I have a course on Dialog Manager if you’re interested in really improving your productivity.
  • 5. 5 “All Right, I’m In, Now What?”: ISPF Settings The first thing to do in ISPF is to make sure your settings are what you want. The settings menu looks like this: Log/List Function keys Colors Environ Workstation Identifier Help ----------------------------------------------------------------------- ISPF Settings Command ===> More: + Options Print Graphics Enter "/" to select option Family printer type 2 Command line at bottom Device name . . . . / Panel display CUA mode Aspect ratio . . . 0 / Long message in pop-up Tab to action bar choices Tab to point-and-shoot fields General / Restore TEST/TRACE options Input field pad . . N Session Manager mode Command delimiter . ; / Jump from leader dots Edit PRINTDS Command Always show split line Enable EURO sign Terminal Characteristics Screen format 2 1. Data 2. Std 3. Max 4. Part Terminal Type 3 1. 3277 2. 3277A 3. 3278 4. 3278A 5. 3290A 6. 3278T 7. 3278CF 8. 3277KN My preferences are above. Your settings may be different depending on how you want to use ISPF. I chose to change the defaults for these reasons: • Command line at bottom off, tab to action bar choices off: I prefer to get to the command line with a single keystroke (the HOME key). If the command line is at the bottom, or if the action bar is tab-able, there is no way to do that. Even with the “tab to action bar” off, you can still use the action bar by placing your cursor on it and hitting ENTER. • Long message in pop-up lets ISPF display long messages at the bottom of the screen rather than restricting it to the line immediately following the command line. In the latter case the long message may not always be displayed in its entirety. On a Mod2 terminal, though, the message box may obscure too many lines (a minimum of three) for your taste. • Always show split line off gives me another line on full-screen splits. The split line always shows up on non-full screen splits. One other thing to keep in mind from this screen is the “Command delimiter,” the character used to separate ISPF commands. Remember what it is; we’ll refer to it later.
  • 6. 6 Settings 2: the Log and List Datasets Let’s look at the settings action bar. The first choice is Log/List. ISPF defaults to logging ISPF commands and errors from your session. There’s no need to log your ISPF session unless you’re running into problems. Go into the Log/List pull-down menu and choose option 1, Log Defaults. To turn off the ISPF log, set the process option to 4 (just in case you need it) and change the primary and secondary pages to 0. That prevents ISPF from allocating a log. To log your ISPF session, go back into this settings menu and increase the number of pages to 200 or so. Get out of ISPF, and then go back in and work as you normally would. When the log allocations are done, go back into the same menu and choose option 2, List Defaults. Increase the number of pages to 200 and change the process option to 3. The list dataset will not be created unless you need it, and process option 3 will keep it when you leave ISPF. Settings 3, Keys 24 The second choice on the action bar is the Function Keys. You can get to the function keys via the KEYS command and the key lists via the KEYLIST command. This is where you set your function keys. The main defaults are: F1 . . . HELP F2 . . . SPLIT F3 . . . EXIT synonym for “END” F4 . . . RETURN go back to main menu F5 . . . RFIND F6 . . . RCHANGE F7 . . . BACKWARD synonym for “UP” F8 . . . FORWARD synonym for “DOWN” F9 . . . SWAP F10 . . LEFT F11 . . RIGHT F12 . . CRETRIEV Conditional retrieve. If on command line, retrieve the previous command. If not on the command line, place the cursor at the beginning of the first input field on the panel. The second set of function keys (13 – 24) is identical to the first. Primary function key values are shown at the bottom of a panel by default. I turn that off because it blocks part of the display. To turn off this display, use the command PFSHOW OFF. To turn the key display back on, use PFSHOW.
  • 7. 7 Function Key Settings continued I’ve changed my function keys and set up some quirks with my keyboard. Here are my primary function keys; my changes are in lower case. F1 . . . HELP F2 . . . SPLIT; F3 . . . end F4 . . . tso F5 . . . RFIND F6 . . . nop F7 . . . up F8 . . . down F9 . . . SWAP F10 . . LEFT F11 . . RIGHT F12 . . sub;end;tso ej;st Look at F2. Remember the semicolon (;) as the command delimiter? The “;” on the end of the SPLIT command lets me split the screen and do something. For example, if I want to split from an edit session and get into DSLIST on the other screen, I enter “3.4” on the command line and hit my F2 key. The semicolon lets me run many commands from a single function key. Note F12; this single key • Submits the JCL I’m currently editing, then saves it; • Puts me into EJES; • Selects the STATUS command. You can run a TSO command from the command line by prefixing the command with the letters TSO. I have set my F4 key to TSO so I don’t have to type those letters. That reduces my keystrokes by three. I’ve set my keyboard so the F6 key is “Erase End of Line” (EOL). The EOL key is “End” by default, but I use “End” to refer to the end of the field I’m on. I don’t use the RCHANGE key, so that was a good candidate to use as EOL. To make sure nothing else happens when using this key, I change the function to No Operation (NOP).
  • 8. 8 Function Key settings continued Most people ignore their second set of function keys (keys 13 – 24). There’s nothing wrong with that, but these keys can be set to less-used but still useful commands or command strings. Here are a few examples: • Set function key 19 to TOP and function key 20 to BOTTOM. Those commands scroll to the top and bottom of any data list immediately, just like UP MAX or DOWN MAX. • Set a commonly-used edit macro. • Set F24 to RETURN. That command gets you out of the application you’re in back to the previous application. • Set a key to any CLIST, REXX exec, or TSO command you often use, prefixed by TSO (e. g. TSO LISTC); • If you commonly create or edit IDCAMS commands, then submit them in an IDCAMS job, you can set up a function key to END;SUB IDCAMS;TSO EJ;ST. That string of commands will save and exit the command parm, submit the JCL to run it, go into EJES, and bring up the STATUS on your submitted job. If your parms are in a separate PDS from your JCL, simply alter the member name to a fully qualified dataset name (e. g. TSO SUBMIT ‘<yourid>.CNTL(IDCAMS)’). In short, a function key can be set to anything you can type on an ISPF command line. A Bonus: Command Line Strings The reverse is also true: you can type a string of commands on the command line, separated by semicolons, and repeat it using the RETRIEVE command. Here’s an example. Say you need to create five copies, numbered 1 – 5, of a job to read five partitions of a database. Assume the database name is PDB0.AD1010xD, where “x” is 1 – 5. Once the first member (say, SCANAD01) is done and saved, on the command line type: s SCANAD02;copy SCANAD01;c AD10101D AD10102D all;end Then hit RETRIEVE, change the 02s to be 03, 04, and 05 in succession, hitting ENTER after each one. Now you have all five members created. This works as long as you plan carefully.
  • 9. 9 The ISPF Main Menu The default setting of the main panel displays session information: 0 Settings Terminal and user parameters User ID . : @TSSQ04 1 View Display source data or listings Time. . . : 10:32 2 Edit Create or change source data Terminal. : 3278 3 Utilities Perform utility functions Screen. . : 1 4 Foreground Interactive language processing Language. : ENGLISH 5 Batch Submit job for language processing Appl ID . : DBA 6 Command Enter TSO or Workstation commands TSO logon : TMP 7 Dialog Test Perform dialog testing TSO prefix: @TSSQ04 8 LM Facility Library administrator functions System ID : SR1 9 IBM Products IBM program development products MVS acct. : **NONE** 10 SCLM SW Configuration Library Manager Release . : ISPF 5.2 There are other settings, set under the STATUS pull-down menu. I use the Calendar option. 0 Settings Terminal and user parameters < Calendar > 1 View Display source data or listings October 2004 2 Edit Create or change source data Su Mo Tu We Th Fr Sa 3 Utilities Perform utility functions 1 2 4 Foreground Interactive language processing 3 4 5 6 7 8 9 5 Batch Submit job for language processing 10 11 12 13 14 15 16 6 Command Enter TSO or Workstation commands 17 18 19 20 21 22 23 7 Dialog Test Perform dialog testing 24 25 26 27 28 29 30 8 LM Facility Library administrator functions 31 9 IBM Products IBM program development products Time . . . . : 10:34 10 SCLM SW Configuration Library Manager Day of year. : 299 There are two advantages to this display. One is the ability to see Julian date equivalents for Gregorian dates. Use the “<” and “>” point and shoot fields to select a calendar month, then put the cursor on a day and hit ENTER. A pop-up panel shows you the Julian date for that day. Another thing you can do is to place your cursor on the “Day of year” field and hit ENTER. A pop-up panel lets you enter any Julian date and convert it to a Gregorian date. Hit F3 to exit the panel. There are two STATUS settings. When the screen is split, the second setting operates in the second screen. You must set this option twice, once in each screen.
  • 10. 10 Getting around in ISPF There are two main ways to get around in ISPF: going through the menus and using the JUMP function. There is an annoying problem with those methods: you have to completely stop what you’re doing. There are two ways to do something without losing your current task. One way is to use the action bars displayed above most panels. For example, on the EDIT main panel (in bold): Menu RefList RefMode Utilities Workstation Help ----------------------------------------------------------------------- Edit Entry Panel Command ===> ISPF Library: Project . . . @TSSQ04 Group . . . . SN1 . . . . . . . . . Type . . . . CNTL Member . . . (Blank or pattern for member selection list) Other Partitioned, Sequential or VSAM Data Set: Data Set Name . . . Volume Serial . . . (If not cataloged) Workstation File: File Name . . . . . Options Initial Macro . . . . Confirm Cancel/Move/Replace Profile Name . . . . . Mixed Mode Format Name . . . . . Edit on Workstation Data Set Password . . Preserve VB record length If “Tab To Action Bar Choices” is enabled, the HOME key takes you to the left-most action bar item. If you’ve turned that off you can still use the action bar by placing the cursor manually over your choice. When you hit ENTER a pull- down menu is displayed. The action bar eliminates the problem of the jump function by bringing you back to your active task when the chosen task is complete. However, the action bars do not list all possible choices, so you are limited to what you can do. As with most things, fortunately, there are ways around this limit.
  • 11. 11 Getting around in ISPF Redux: The Commands Table You can write your own ISPF commands to run existing or new functions. To manage ISPF commands, use option 3.9 to create a commands table. The first screen for the ISPF commands table interface looks like this: .------------------------------- Commands --------------------------------. | Command Table Utility | | Command ===> | | | | Specifications Command search order | | Application ID . . DBA Application table : DBA | | Enter "/" to select option User table . . . . : | | Show description field Site table . . . . : | | System table . . . : ISP | | | | If no application ID is specified, the current application ID will be | | used. The name of the command table to be processed is formed by | | prefixing the application id to the string 'CMDS'. For example: | | Application ID . . TST results in a command table name of 'TSTCMDS'. | | | | | | | '-------------------------------------------------------------------------' The Application ID field tells ISPF the name of the commands table. You can choose any two-, three-, or four-character application ID you want as long as it’s not ISR or ISP. In the print above DBACMDS is the commands table for the DBSS Toolbox. This utility displays your active commands table without allowing changes. To make changes you must run under a different application ID, make the changes, and then restart ISPF with the correct applid.
  • 12. 12 The Commands Table continued Here are a few commands from the ISR/ISP command list display: Verb T Action BACKWARD 0 ALIAS UP BACKWARD = UP BOTTOM 0 ALIAS DOWN MAX FORWARD 0 ALIAS DOWN TOP 0 ALIAS UP MAX ACTIONS 0 ACTIONS AUTOTYPE 0 SETVERB This is an existing command CANCEL 3 CANCEL Provides the abbreviation CAN CMDE 0 SELECT PGM(ISPCCMDE) Calls a dialog program To invoke a commands table, ISPF must be started with that application ID. Unfortunately, the ISPF or PDF commands do not allow you to easily specify the application ID. You must write your own ISPF-equivalent command to do that using the ISPSTART command. As an example, the command to start ISPF using the DBA commands table is: ISPSTART PANEL(ISR@PRIM) NEWAPPL(DBA) ISR@PRIM is the primary menu panel for ISPF. The NEWAPPL argument must be the same as the application ID you gave your commands table. It’s up to you to determine whether coding this (and remembering a different ISPF command) is better than working without a separate commands table. Here is the DBA commands table. Note the execution calls are to the Dialog Manager Select service: Verb T Action DLIST 0 SELECT PGM(ISRUDL) PARM(ISRUDLP) PANVALET 4 SELECT PGM(PSPILINI) NOCHECK PRS 0 SELECT CMD(PRB#PRS) QW 0 SELECT CMD(QW) DEBUG 0 SELECT CMD($DEBUG ON) NODEBUG 0 SELECT CMD($DEBUG OFF) TON 0 SELECT CMD($DEBUG ON) TOFF 0 SELECT CMD($DEBUG OFF) BM 0 SELECT CMD(BOOKMGR) DBTOOLS 3 SELECT PANEL(DO$TOOLS) AFMON 3 SELECT CMD(AFMON) FAMVS 0 SELECT CMD(FAMENU) FAIMS 0 SELECT CMD(FIMENU) SUPPORT 0 SELECT CMD(SUPPORT) EJ 0 SELECT PGM(EJ) PARM(&EJTRAIL) NEWAPPL(EJES) NOCHECK If you’d like to implement this concept I’d be happy to help.
  • 13. 13 Getting the Most from the ISPF Editor Whether we realize it or not, the majority of our work is done in the ISPF editor. The editor is a very powerful tool, with many features we can use with a minimum of training. But First, a Word on View View lets you use the editor commands on a file without the risk of accidentally changing it. Almost everything said about Edit applies to View. Edit and Line Labels The numbers on the left of any edit session are not true line numbers; they are line labels. This is where line commands go. Although they are renumbered when you renumber your data, they are valid only in a given edit session. Line labels are used for messages as well as marking locations. Some examples of messages are =NOTE=, ==CHG> (the line has one or more changes on it), or dashes (one or more excluded lines). Three labels are defined but are not displayed: .ZFIRST, .ZLAST, and .ZCSR (for first, last, and cursor’s line). First and last can be abbreviated as .ZF and .ZL respectively. You can create your own labels. Just start the label line with a period and type a name for that line. For example, in bold below: File Edit Edit_Settings Menu Utilities Compilers Test Help ------------------------------------------------------------------------------- EDIT @TSSQ04.SN1.EXEC(DFOICF) - 01.03 Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 /* REXX DFO's copy of ICF to preserve my own allocations. */ 000002 /* */ 000003 /* Original code in 'TSOPROC.CLIST(ICF)'. */ 000004 /*--------------------------------------------------------------------*/ .HERE "PROF MSGID" Label “HERE” 000006 CVT = C2X(STORAGE(10,4)) 000007 CVT_154 = D2X(X2D(CVT) + X2D(154)) 000008 CVT_M20 = D2X(X2D(CVT_154,8)) 000009 SID = STRIP(STORAGE(CVT_154,8)) .THERE PID = SUBSTR(SID,2,1) Label “THERE” Labels are useful to set ranges for primary commands or to quickly get to one or more areas in your dataset. This topic is discussed further under the primary commands section.
  • 14. 14 Data Line Numbers Data line numbers are optional. If you want data line numbers, you must use the NUMBER ON command. Numbers are often used in COBOL, Assembler, or JCL. Respectively, NUMBER ON COB or NUMBER ON STD sets the proper numbers. To automatically maintain line numbers, use the AUTONUM command. Scrolling The scrolling amount is displayed in the upper right of the session. I’ve found it useful to set this to CSR, or cursor. That lets me decide how much to scroll. You can always override the scroll amount by typing the amount on the command line and hitting the scroll key, or by typing the scroll command followed by the amount. For example, to scroll down five lines: Command ===> down 5 Command ===> 5 followed by the F8 key. Scrolling obeys BOUNDS (see below). If the scroll amount exceeds the BOUNDS limit, scrolling stops at the bound. To scroll past the bound hit the same scroll key again. The upper limit to scrolling (except MAX) is 9,999 lines or columns. Command Abbreviations Almost all primary commands can be abbreviated. The abbreviation is usually the shortest number of characters used to exclusively identify the command. For example, two commands begin with “RE”: RESET and RENUM. Specifying RE as your command will result in an error. However, you can use RES and REN respectively instead of typing the command name completely. The abbreviation for some commands is not the first three characters. An example is C or CHG for the CHANGE command. Some commands use both; for example, EX and X are both valid abbreviations for the EXCLUDE command.
  • 15. 15 The EDITSET command Some edit parameters can be set using the EDITSET (EDSET) command. The command displays a pop-up menu to set up your edit session defaults. .-----------------------------------------------------------------------------. | Edit and View Settings | | Command ===> | | More: + | | Settings for current and future Edit and View sessions: | | | | User session initial macro . . . . . . . . . . . . . . DFOIMAC | | Maximum initial storage allowed for Edit and View . . 0 | | Target line for Find/Change/Exclude string . . . . . . 1 | | Enter "/" to select option | | Always position Find/Change/Exclude string to target line | | / Remove action bars in ISPF edit and view panels | | | | CUT default . . 2 1. Append PASTE default . . 2 1. Delete | | 2. Replace 2. Keep | | | | Settings for future sessions. Select Apply Setting Immediately for the | | setting to affect the current session as well. | | | | Enter "/" to select option | | Confirm Cancel/Move/Replace Apply Setting Immediately | | Preserve VB record length Apply Setting Immediately | | | '-----------------------------------------------------------------------------' To give me more room in my edit sessions I check the “Remove action bars…” field. Action bars remain on the main edit panel and member lists but do not appear when I’m editing data. I also change the target line for find/change to be 1 (the first displayed line). That’s a personal preference, not a suggestion.
  • 16. 16 Member Selection The “%” and “*” characters represent a single character and many characters respectively. This can be done anywhere you can specify a member name. Keep in mind, using a single asterisk in place of a member name or mask is considered the entire member list. Some examples: • %%ABC selects all 5-letter member names ending in ABC; • ABC* selects all members beginning with ABC; • A*B*C selects all members beginning with A, ending in C, and having a B somewhere between the first and last characters. Additional Member List Commands REFRESH resets the member list to what’s currently there. RESET clears the line command and prompt fields. SAVE prints the member list to the LIST dataset or a dataset named on the SAVE command. For example, SAVE BASE creates a dataset called <yourid>.BASE.MEMBERS. SELECT can be used as a line or primary command. Where it is appropriate (e. g. resetting statistics, copying), you can use the mask characters to select a group of members (e. g. S ABC*). SORT can sort the member list on any of these fields: PDSes with formatted records: PDSes with unformatted records: Field Sort Sequence Field Sort Sequence ---------------------------- ----------------------------- NAME Ascending NAME Ascending LIB Ascending LIB Ascending VV Ascending SIZE Descending MM Ascending TTR Ascending CREATED|CRE Descending ALIAS-OF|ALIAS Descending CHANGED|CHA Descending AC Ascending SIZE Descending ATTRIBUTES|ATTR Descending INIT Descending AM Descending MOD Descending RM Descending ID Ascending SSI Ascending This suggests a couple of little tricks. To edit the most recently changed member, do SORT CHANGED before looking for the member. To see all members edited by a person, type SORT ID.
  • 17. 17 You can also sort on these fields by placing a cursor on the column header and hitting ENTER.
  • 18. 18 “Make Sure You Get My Best Side:” Edit Profiles When you edit a dataset, the editor wants to know how to handle the data. It also has many features to help you code JCL and programs. ISPF stores this information in edit profiles. ISPF uses a profile based on 1) the dataset type and 2) the LRECL of the file. Dataset type is based on the last qualifier of the dataset name. You can have a profile called DATA (Fixed 80), another called DATA (Fixed 133), and so on. ISPF limits you to 25 profile types by default; installation defaults can be different. When a profile beyond the limit is needed, the least recently used profile is dropped from the list to make room for the new one. If you edit many different file type/LRECL combinations, it is possible to lose one and have to “set it up” again. Some useful profile options are: RECOVERY Recover if edit session breaks, plus allows UNDO; default is OFF NULLS NULLS ON allows easy insertion of characters; default is OFF TABS Logical, hardware or software tabs are available; default is OFF STATS Keeps statistics for PDS members SETUNDO Are UNDO capabilities on? HILITE Alters colors of specific characters or words BOUNDS and MASK settings are also stored in the profile. MASKs can be used to preset data on inserted lines. BOUNDS defines limits for the following primary commands: FIND, CHANGE, EXCLUDE and SORT. Bounds also affect the operation of the text line, data shifting, and scrolling commands. The default lines for MASK and TAB lines are all blanks. The default bounds are the first and last bytes of the dataset record length, minus numbers if it applies. For example, a DATA LRECL of 80 sets the right bound to 80; a JCL member with numbers sets the right bound to 72.
  • 19. 19 Edit Profiles continued The PROFILE command displays the current profile. It can also lock the profile from further changes (PROFILE LOCK). The profile is displayed as a series of =>PROF lines, which can be removed using the D/DD line commands or the RESET primary command. MASK: when turned on, causes a mask to be presented on every inserted line. For example, setting the MASK in a CNTL PDS as “//” begins each line with the slashes. If you don’t want the mask on a line, it can be overtyped. BOUNDS: the BOUNDS primary or line command sets limits for scrolling, text, and many other commands. The primary command BOUNDS with no arguments resets them to the default. RECOVERY: when turned on, ISPF keeps track of your edit session. You can then recover your changes if your edit session crashes. Recovery is automatic, but you have a choice of deferring or skipping the recovery. RECOVERY also allows use of the UNDO edit command. UNDO works the same way as the undo you find in Microsoft products such as Word or Excel. It backs out all changes made since the previous ENTER or edit command. To turn on edit recovery, type RECOVERY ON. This is recommended. SETUNDO: when turned on, the edit session can use the UNDO command without turning RECOVERY on. The command is either SETUNDO STG (do the undo on the in-storage copy) or SETUNDO REC (do the undo in the recovery copy). There are two advantages to SETUNDO STG: 1. It’s faster; 2. It does not turn recovery on. NULLS: by default, blanks on the end of a line are considered valid characters (spaces). With NULLS OFF, if you try to insert characters on a line, the insertion is not allowed. You must delete characters or erase to end-of-line before inserting any characters. I set NULLS ON so I don’t have to constantly delete or erase characters.
  • 20. 20 Edit: Using Tabs With TABS ON, the editor can determine where to put the cursor. You can let the editor decide where to put the cursor, or use the TAB keys on your keyboard to position the cursor. Because the tab line is used for all tabs, it may contain asterisks, dashes, or underscores. All tabs are set using the TABS line command. • Software tabs are set by typing dashes or underscores on the TABS line over the areas you want to tab to. For example, this sets three tab areas: TABS ---------- ------- -------- Software tabbing does not provide tab locations, therefore the TAB key does not work with these tabs. The editor uses these tabs to position the cursor in the general area it needs to be in. • Hardware tabs are accessed using the keyboard’s TAB key. The edit screen has two hardware tabs set: one at the line labels and one at the first byte of the data line. You can set more hardware tabs by placing an asterisk on the tab line just before you want your field to start. The editor will not let you type on top of a hardware tab. For example, this sets three tabs at positions 10, 16, and 36: =COLS> ----+----1----+----2----+----3----+----4----+--- TABS * * * To turn off hardware (or logical) tabs, type TABS OFF (clears all tabs) or space out the asterisk(s) on the TABS line. • Logical tabs are represented by a character, e. g. “TAB ¬”. To set data areas as 1-9, 10-15, 16-35, and 36-72, set up your TABS line as: =COLS> ----+----1----+----2----+----3----+----4----+--- =TABS> - * * * When you enter lines like this: 000100 ¬la¬0,0¬clear counter register 000200 *¬¬¬to initial value the result is: =COLS> ----+----1----+----2----+----3----+----4----+--- 000100 LA 0,0 CLEAR COUNTER REGISTER 000200 * TO INITIAL VALUE
  • 21. 21 Edit Primary Commands In no particular order, here are some useful commands you enter on the command line. Note: • Primary command operands are separated by commas or spaces. • Trailing blanks are treated as nulls (you can’t use the cursor keys to make spaces between operands). • If an error occurs, the command remains on the command line. • To force the command to remain on the command line, prefix it with an ampersand (&). DELETE deletes selected lines. Lines can be selected by exclusion, non- exclusion, or by labels. Here are two examples: DELETE ALL X deletes all excluded lines; DELETE ALL .a .b deletes all lines between label A and label B, inclusive. SORT sorts data, observing bounds. The entire record is subject to sorting unless bounds are set. If bounds are on, only the data within the bounds is sorted and moved; other data is not moved. This is a way to sort columned data separately. Sort lets you sort fields in either ascending or descending order. The maximum number of sort fields is five. When using multiple fields, both start and end columns must be provided. Default is ascending sort. If one field specifies ascending or descending, all fields must specify it. Here are a few examples: SORT 10 sorts from column 10 to the right bound; SORT 1 8 sorts based on the data within columns 1 through 8 inclusive; SORT 1 15 X sorts all excluded lines based on the data in columns 1 through 15; SORT 1 15 A 20 20 D sorts all lines based on two fields, the first field in ascending order and the second in descending order. Note the second field is a single byte. EDIT calls the editor recursively. If you are editing a member and need to briefly edit another member, and then return to your original member, typing EDIT <member> on the command line does that. BROWSE and VIEW are similar commands for browsing and viewing members respectively.
  • 22. 22 More Edit Primary Commands UNDO undoes all changes made since the previous ENTER or function key was pressed. You can continue to undo changes until all changes have been reversed. However, you cannot undo initial macro changes. UNDO is available only if RECOVERY or SETUNDO is on. LOCATE finds a line label. The label can be the “line number”, any special label (e. g. =NOTE=, ==ERR>), your own label, or a pending line command. Here are a few examples: • LOCATE ERR FIRST locates the first error line; • LOC CHG NEXT locates the next changed line; • L .HERE locates the label “.HERE” • L 450 locates line label 000450; • L SPECIAL locates the next special line (e. g. COLS, MASK, etc.); • L LABEL PREV locates the previous label. RESET clears all line commands, reshows excluded lines, deletes special lines, clears all line flags, and turns off the last FIND highlight. RESET with no operands cleans up everything except line labels. Operands can be provided to specify exactly what to reset: label remove line labels command (CMD) remove pending line commands error remove ERROR notes change (CHG) remove CHANGED notes excluded (X) redisplays excluded lines special Deletes all special lines (=PROF>, =BNDS>, =TABS>, ==MSG>, =NOTE=, =MASK>, =COLS>, and ======) find reset FIND highlighting FLIP swaps excluded and included lines. BOUNDS with no operands sets boundaries to the default. You can set left, right, or both boundaries. Both left and right bounds must be supplied; an asterisk is used as the placeholder. To set the right bound to 60 you’d type BOUNDS * 60; to set the left bound to 10, type BOUNDS 10 *.
  • 23. 23 Edit Primary Command: Submit SUBMIT passes the data to the TSO SUBMIT command. You can submit all the JCL or just that within a range. If the LRECL is greater than 80 bytes, each record is truncated to 80 bytes. If the LRECL is less than 80 bytes, it is padded with blanks up to 80 bytes. The editor submits all job streams in a single member. Job cards separate job streams; the null statement (“//”) is not required. If you have members set up like this and you want to submit only one of the job streams, you can mark the job stream with labels (e. g. .HERE and .THERE) and then type SUB .HERE .THERE to submit only that JCL. Command ===> sub .here .there Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //SPDO001T JOB SP218ZZDFO9999A044,'ODEA 77184',USER=@TSSQ04, 000002 // MSGLEVEL=1,MSGCLASS=H,PRTY=4,NOTIFY=@TSSQ04 000003 //*FORMAT PR,DDNAME=,DEST=TMNODE1.RM005 000004 //*MAIN CLASS=TSS04 000005 //** 000006 //STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=90 000007 //********************************************************************** 000008 //* RUN TSO AND DO WHAT IT SAYS. 000009 //********************************************************************** 000010 //SYSTSIN DD * 000011 LISTC LEVEL(@TSSQ04) ALL 000012 //SYSTSPRT DD SYSOUT=* 000013 // .here //SPDO002T JOB SP218ZZDFO9999A044,'ODEA 77184',USER=@TSSQ04, 000015 // MSGLEVEL=1,MSGCLASS=H,PRTY=4,NOTIFY=@TSSQ04 000016 //*FORMAT PR,DDNAME=,DEST=TMNODE1.RM005 000017 //*MAIN CLASS=TSS04 000018 //** 000019 //STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=90 000020 //********************************************************************** 000021 //* RUN TSO AND DO WHAT IT SAYS. 000022 //********************************************************************** 000023 //SYSTSIN DD * 000024 LISTC LEVEL(@TSSQ03) ALL .there //SYSTSPRT DD SYSOUT=* ****** **************************** Bottom of Data ****************************
  • 24. 24 More Edit Primary Commands PROFILE displays the current edit profile. To prevent permanent changes, use PROFILE LOCK. PROFILE UNLOCK unlocks the profile to allow changes. If you specify a number from 0 – 8 ISPF displays that many lines of the profile. Even if a profile is locked, you can change it for the current session. Changes are temporary and are dropped when you leave the session. You can change which profile you’re using for the current dataset by naming it with the command. For example, to use a text profile, type PROFILE TEXT. If the profile does not exist, ISPF creates a new one for you. To change profiles without displaying the new one, type PROFILE <name> 0. COMPARE calls SuperC to compare the current edit session with another file. Lines existing only in the current file are marked with labels. Lines existing only in the other file are shown as information lines. You can add those lines to the current file using the MAKEDATA command (see Edit Line Commands, MD). COMPARE with no arguments presents the Edit Compare Settings panel. Otherwise a DSN or member name is required for the file to be compared to. In place of the DSN you can use SESSION or an asterisk to compare the current edit session with the same dataset stored on disk. Other keywords are: • EXCLUDE or X excludes matching lines, leaving only differences visible; • SAVE saves the output to a dataset called ISPFEDIT.COMPARE.LIST; • SYSIN does not free the SYSIN DD before invoking SuperC. That lets you pass more parameters to SuperC. EXCLUDE excludes from view any lines you choose. When used as a primary command, EXCLUDE functions as a FIND command might (see below): 1. EXCLUDE ALL “C” 72 excludes all lines with a “C” in column 72; 2. EX WHILE ALL excludes all lines with the text WHILE on them; 3. X ALL excludes every line in the dataset. A FIND command unexcludes any lines with the find string on it. For example, in a JCL member, to show only those lines with program names on them (X ALL;F PGM= ALL): ****** ***************************** Top of Data ****************************** - - - - - - - - - - - - - - - - - - - 11 Line(s) not Displayed 000012 //ACBA EXEC PGM=DFSRRC00,PARM='UPB,' - - - - - - - - - - - - - - - - - - - 15 Line(s) not Displayed 000028 //ACBB EXEC PGM=DFSRRC00,PARM='UPB,' - - - - - - - - - - - - - - - - - - - 15 Line(s) not Displayed ****** **************************** Bottom of Data ****************************
  • 25. 25 The FIND Command FIND is usually used with the operands NEXT (the default), PREVIOUS, ALL, FIRST, or LAST. Special characters (e. g. the “*” or quotes) must be surrounded by quotes. Sometimes the string may be a keyword to the FIND command, in which case it needs to be quoted (for example, FIND ‘NEXT’ or FIND ‘FIRST’ ALL). One FIND option many people are not familiar with is the picture string. Here is a list of the types of picture strings and their explanation: = any character . invalid characters @ alphabetic characters - non-numeric characters # numeric characters < lower case alphabetics $ special characters > upper case alphabetics ¬ non-blank characters Picture strings are called using the letter P followed by the quoted character. For example, FIND P’.’. Strings are located regardless of case. The following are the same: 1. F TEXT 2. FIND Text 3. f teXt If you need to find the exact match, including case, use the letter C as a prefix or suffix to the quoted string, e. g. F c’Text’. Finds are restricted by columns or labels. For example, F JUNK .HERE .THERE finds the first occurrence of JUNK beginning at the label .HERE. If there is no such text between the labels, the message JUNK NOT FOUND is displayed, even if that text exists outside the labels. See the example on the next page. If you get the “But I can see it, it’s right there!” feeling when doing a FIND, check the bounds to make sure Edit is actually looking everywhere.
  • 26. 26 The FIND Command continued In this example a left boundary is set at column 12 and a right boundary is set at column 60. The F DBD command with the default bounds would find the DBD in DBDLIB on line 3. Since FIND observes boundaries, the first one found is the DBD on line 4 (highlighted on the screen, in bold here). Command ===> f DBD Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 /* REXX IMS Database DDname retriever */ =BNDS> < > =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-- 000002 /**************************************/ 000003 Arg DBDLIB 000004 If DBDLIB = "" Then Do /* Assume DBD is gotten from IMS table */ 000005 Address ISPEXEC "VGET (BDBDLIB) SHARED" Other parameters FIND can use are CHARS, PREFIX, SUFFIX, and WORD. Using those, and assuming this line: DO DONT ADO ADOPT 'DO' $ADO (DONT) ADO- FIND DO CHARS finds all these words; FIND DO PREFIX finds only DONT and (DONT); FIND DO SUFFIX finds only ADO, $ADO, and ADO-; FIND DO WORD finds only DO and ‘DO’. FIND operands may be entered in any order; for example, FIND ALL X DOG and F DOG X ALL are the same.
  • 27. 27 The CHANGE Command The CHANGE command has the same operands, working the same way, as the FIND command. Refer to the FIND command description for more information on CHANGE. All picture strings can be used as the FROM operand in a CHANGE command. Only the ‘=’, ‘>’, or ‘<’ characters may be used in the TO operand. This suggests the following: to change all lower-case characters in a dataset to uppercase, use the command c p'<' p'>' (might be a good idea to set up a function key for that…). FROM strings are located regardless of case. The following are equivalent: 1. C TEXT DOC 2. C Text DOC 3. C teXt DOC If you need to make an exact match, including case, you can use the letter C as a prefix or suffix to the quoted string, e. g. c c’Text’ Doc all. However, the TO operand will be passed as-is. The following are NOT the same: 1. C TEXT DOC 2. C TEXT Doc 3. C TEXT doc As with FIND, CHANGE operands may be entered in any order. There is only one exception: the FROM and TO fields must remain in that order. In other words the FROM operand must always be immediately followed by the TO operand.
  • 28. 28 Highlighting Highlighting is an excellent way of checking your code (REXX, JCL, COBOL etc.). HILITE is not a true command parser and sometimes gives strange results, but it can be useful to identify what may be wrong with a given line of code. HILITE ON turns on highlighting without logic checks (i. e. IF/THEN or DO/END). HILITE LOGIC turns on logic highlighting only. You can specify IFLOGIC or DOLOGIC to highlight only IF or DO logic. HILITE AUTO lets ISPF determine, based on the file type, what keywords or characters are highlighted. You can specify the language ISPF is to use (e. g. HILITE COBOL). Valid HILITE languages are: AUTO ASM C COBOL DTL IDL JCL PANEL PASCAL PLI OTHER REXX BOOK SKEL DEFAULT OTHER is similar to PLI but with only the most basic logic and command structure. DEFAULT is used when HILITE AUTO is typed but the language cannot be determined. CNTL is JCL and EXEC is REXX. Other HILITE options are: 1. HILITE PAREN toggles the highlighting of mismatched parentheses; 2. HILITE FIND toggles the highlighting of the FIND command; 3. HILITE CURSOR toggles the highlighting of the current cursor word; 4. HILITE SEARCH highlights the first unmatched END, ELSE, }, or ) between the first line of the dataset and the line the cursor is on. This is most useful when you’re on the last line of the dataset. Entering HILITE with no operands displays a panel to set up the highlighting coloring options.
  • 29. 29 External Data Commands: Create, Replace, Copy, Move, and Model The external data commands are alike in two ways: • they require line references (using C/CC, M/MM, B, A, etc.); • they can be used with dataset names, members, or no operands. If a member name is specified it must be in the PDS being edited. If no member name or dataset name is provided, a screen is displayed to enter a source or destination dataset. Rather than scrolling around to find a place to put the data on a COPY or MODEL, you can specify AFTER or BEFORE and a label. Labels can be used to mark the data rather than using line commands. The line commands are described in more detail in the next section. For external data commands, you need to know only Copy (C/CC), Move (M/MM), Before (B) or After (A). Remember .ZF and .ZL? You can use those labels to copy or move the entire contents of the dataset instead of entering C/M99999 on the first line label. Create and Replace CREATE makes a new member or dataset from within the current edit session. These can be either copies using the C/CC line commands, moves using the M/MM commands, or a range using labels. When lines are moved they are deleted from the current dataset as if you’d deleted them manually. If the destination member or dataset exists, CREATE fails. You can replace the destination using the REPLACE command, which works exactly as the CREATE command does. To create a member in the current PDS, type the member name. To create a new dataset, type the DSN after the CREATE command. Some examples: • CREATE opens a screen to enter a member name or dataset to create; • CREATE JUNK creates a member in the current PDS called JUNK; • CREATE JUNK .ZF .ZL copies all lines into the member JUNK; • CREATE MYJCL.EXTRACT creates a sequential file called <yourid>.MYJCL.EXTRACT; • CREATE JUNK .HERE .THERE creates the member JUNK using only the data delimited by the two labels. The lines are not deleted.
  • 30. 30 External Data Commands: Copy and Move COPY inserts one or more lines from another dataset into the current edit session. Use the A or B line commands, or the AFTER or BEFORE keywords with a label, to tell Edit where to put the new lines. You are not required to copy the entire dataset when using COPY. You can choose which lines to copy from the source file. Simply type the start and end line from within the source file as part of the copy command. As with CREATE/REPLACE, if you don’t type a file name on the command, you are shown a screen to enter the information the command needs. At the bottom is the place to enter the line numbers. Be careful here. Since it will let you use line numbers if the dataset has them (e. g. COBOL or JCL), you must type an “R” in the “Number Type” field (for relative record numbers) or the copy command may not do what you want. If the MOVE command is used, once the data from the source file is copied in, the source file or member is deleted. Some examples of COPY/MOVE commands are below. • COPY opens a screen to enter a member name or dataset to copy in; • COPY JUNK copies in the member JUNK from the current PDS; • MOVE JUNK copies the data from the member JUNK and deletes it; • COPY MYJCL.EXTRACT AFTER .HERE locates the label .HERE and copies the entire contents of MYJCL.EXTRACT following that line; • MOVE MYJCL.EXTRACT 1 6 BEFORE .ZF copies lines 1 through 6 of MYJCL.EXTRACT into the current edit session as the first six lines of the file, then deletes MYJCL.EXTRACT.
  • 31. 31 Cut and Paste Edit provides CUT and PASTE commands similar to the PC cut and paste commands. ISPF provides a default clipboard to hold data items cut. The syntax for CUT is essentially the same as that for CREATE; the syntax for PASTE is essentially the same as that for COPY. The following operands apply to CUT: • REPLACE replaces the contents of the clipboard; • APPEND adds the cut text to the bottom of whatever is on the clipboard; • DISPLAY shows what’s on the clipboard. Other operands are ignored. The following operands apply to PASTE: • DELETE clears the clipboard contents; • KEEP keeps the clipboard as-is. Use the EDITSET command to set up cut and paste. A Word on Models ISPF provides skeletal models of many different types of data. You can call in a model of a dialog function (e. g. panel, skeleton, or table define), a program (e. g. COBOL, REXX exec), or function call (e. g. VPUT). Most people do not use models because it’s simpler to copy in a similar piece of data and modify it to suit. The ISPF models are generic, and useful if you’ve forgotten the syntax of some command. To call in a model use the MODEL command. Provide the name of the model (and its sub-name, if needed), and tell ISPF where to put it using either A or B line commands or labels (a la COPY).
  • 32. 32 Edit Line Commands Edit line commands are entered on the line labels to the left of the data section. Many line commands act with primary commands. Line commands fall into seven families: • Basic commands (e. g. insert); • Move/Copy commands; • Shifting commands (e. g. shift left); • Exclude/Show commands; • Text handling commands (e. g. text splitting); • Data command (MD); • Miscellaneous commands. If you have created your own labels it’s OK to type line commands over them. Your labels will not be removed by doing so; the primary command RESET LABELS is needed to do that. Line commands can take one of three forms: 1. a single character referring to a single line; 2. the command followed by a number refers to the number of lines, starting at the line the command is on. For example, D3 deletes three lines; 3. the character entered twice indicates a block is to be handled. For example, the CC command begins or ends a block copy operation. As many line commands as desired can be entered as a single operation as long as they don’t interfere with each other. A Caveat The editor uses a combination of blanks and cursor location to decide what the number entered should be. Trailing blanks are ignored, as are any numbers or letters following the cursor position in the label field. A common problem is to type a number corresponding to the line number. Say, when shifting right 1 byte, you type “))1” on line 001200, resulting in “))1200". If the cursor is moved away before ENTER is hit it appears as if the line numbers were not changed. The result ends up being the same as if “))” were hit, so the numbers are shifted two bytes rather than one. To avoid that, type a blank after the 1, as “))1 00”.
  • 33. 33 Basic Line Commands: I, D, and R The “I” command inserts lines, the “D” command deletes lines, and the “R” command repeats lines. These three commands provide the most basic edit functions. The D and R commands may be blocked (DD and RR respectively). All three commands may be followed by numbers to insert, delete or repeat that many lines. Copy and Move commands The “C” command copies, and the “M” command moves, lines within an edit session. Both may be blocked using CC and MM respectively. Both commands require the use of the “A” and “B” line commands to determine where the copied or moved lines are to be placed. A number can follow “A” or “B” commands to indicate how many times the line or lines are to be copied or moved. For example, this takes the first line and copies it twice after the fourth line (commands in bold). ****** ***************************** Top of Data ****************************** C 0001 /* REXX COPYOVER coded December 2001 */ 000002 /**********************************************************************/ 000003 /* Do an ISPF EDIT-like copy with overlay when there are many */ A2 004 /* alternating lines of data. Saves wear and tear on the carpal */ Both the copy and move commands can be used to overlay other lines. The “O” line command indicates where to overlay. “O” can also be blocked (OO). In this example the third line will overlay the fourth as a move. ****** ***************************** Top of Data ****************************** 000001 /* REXX COPYOVER coded December 2001 */ 000002 /**********************************************************************/ m 0003 /* */ o 0004 Do an ISPF EDIT-like copy with overlay when there are many 000004 /* alternating lines of data. Saves wear and tear on the carpal */ As a block overlay, do this. ****** ***************************** Top of Data ****************************** 000001 /* REXX COPYOVER coded December 2001 */ 000002 /**********************************************************************/ m 0003 /* */ oo 004 Do an ISPF EDIT-like copy with overlay when there are many oo 004 alternating lines of data. Saves wear and tear on the carpal
  • 34. 34 Edit Line Commands: Shifting Two kinds of data shifting are provided: column shifting and data shifting. The column shift characters are parentheses; data shift characters are the angle brackets (greater than or less than signs). Data shifting is used on indented code. Column Shifting Column shifting moves data left or right the specified number of columns. The default movement is two columns. A single parenthesis shifts a single line; double parentheses shift a block of lines. Bounds are observed as left or right limits. =BNDS> < > )5 300 DATA1 DATA2 DATA3 (' ') DATA4 DATA5 results in =BNDS> < > 000300 DATA1 DATA2 DATA3 (' ') DATA4 DATA5 The text DATA1 has not moved since it’s out of the boundaries. The editor does not consider loss of data an error on shifting. Here’s the result of the shift if we shifted ten columns instead of five. =BNDS> < > 000300 DATA1 DATA2 DATA3 (' ') DATA4 The text DATA5 has vanished since it’s been shifted beyond the LRECL limits. This feature is useful to mass delete data. Set an appropriate left or right bound, then shift characters in that direction using a number larger than the number of characters.
  • 35. 35 Data Shift Line Commands: Data Shifting Data shifting moves data left or right the specified number of columns, but the logic is different. Data shifting takes the first non-blank field after the first blank and shifts it to a) accommodate the shift request and b) remove blanks from the line. The default movement is two columns. A single angle bracket moves a single line; double angle brackets shift a block of lines. Bounds are observed as left or right limits. =BNDS> < > >5 300 DATA1 DATA2 DATA3 (' ') DATA4 DATA5 results in =BNDS> < > 000300 DATA1 DATA2 DATA3 (' ') DATA4 DATA5 DATA1 is not shifted because it is outside the current bounds. DATA2 is not shifted because it starts in the left column. DATA3 is shifted five columns as requested by >5. (' ') is shifted but the blanks inside are unchanged. DATA5 does not require shifting and is left unchanged. What happens when the requested movement is too large? In a column shift data is lost. When data shifting data is not lost; shifting is changed to match that requirement. If we shifted ten characters instead of five, this happens. =BNDS> < > =ERR=> DATA1 DATA2 DATA3 (' ') DATA4 DATA5 DATA3 is shifted as far as it can be shifted without: • losing data, • shifting data beyond the right bound, • deleting single blanks, • deleting blanks within apostrophes. The line is marked with an error flag since shifting was not completed as requested.
  • 36. 36 Edit Line Commands: Exclude and Show Lines We’ve talked about excluding lines using the EXCLUDE primary command, and how the RESET command reshows excluded lines. The line commands X, S, F, and L provide better control over this process. The “X” command excludes one or more lines based on a number. For example, X3 excludes the current line and the following two lines. You can exclude a block of lines using “XX”. The “F” and “L” commands show the first and last lines of the excluded block respectively. While they cannot be blocked, you can provide a number. For example, F5 unexcludes the first five lines of the excluded block. If the number requested is larger than the number of excluded lines, all lines are unexcluded. The “S” command shows the “most significant line(s)” of the excluded block. Significance is determined by the amount of indenting. If all lines requested by the “S” command are equally indented, the first lines are shown.
  • 37. 37 Edit Line Commands: Text Handling There are five text-handling commands: TS (text split), TF (text flow), TE (text enter), LC (lower case), and UC (upper case). Case The two text line commands dealing with case are LC (lower case) and UC (upper case). LC converts all characters on the line to lower case; UC converts all characters on the line to upper case. Text Split Let’s say we have these two lines (the – is the cursor). ts 400 This line will be split in two to allow insertions 000500 into the text. - The result is: 000400 This line will be split in two '''''' 000410 to allow insertions 000500 into the text. Each time a text split occurs, a blank insert line appears between the results of the split. That allows more typing and less use of the TS line command. If you want more than one line, add a number on the end of the TS command. As with many commands, bounds are observed. That allows print column- type processing, e. g. from this. =BNDS> < > ts 400 This is text data on the This is text data on the 000500 left side. - right side. to this: =BNDS> < > 000400 This is text data This is text data on the '''''' - 000410 on the 000500 left side. right side.
  • 38. 38 Edit Line Commands: Text Handling continued: Text Flow Text flow combines sentences into a more-or-less clean paragraph. The flow is stopped at a blank line, or at indentations. Let’s say we have these three lines: tf 400 These lines illustrate the text flow command, in 000500 which text is connected to other text 000600 on other lines to make paragraphs. The result is: 000400 These lines illustrate the text flow command, in which text is 000500 connected to other text on other lines to make paragraphs. Flowed words are connected by a single blank. Periods are followed by two blanks. Extra blanks embedded in a line are not compressed out. Using a number with TF indicates the width of the text being flowed. In the above example, if we used TF40 instead of TF the result is: 000400 These lines illustrate the text flow 000500 command, in which text is connected to 000600 other text on other lines to make 000700 paragraphs. Text Entry The TE line command formats the edit session to emulate a word processor to allow power typing. In this mode, line labels are not displayed and your typing remains only in the editor’s data window. When you’ve finished typing, your new text is flowed together as if you entered the TF command. Here’s an example: te 400 following this line. The text entry command formats the display so that entr y of text can be made without regard to end of line consider ations. When ENTER is hit, the result is: 000400 following this line. 000410 The text entry command formats the display so that 000420 entry of text can be made without regard to end of line 000430 considerations.
  • 39. 39 Miscellaneous Line Commands Three line commands are used in conjunction with your profile and primary commands: BNDS, MASK, and TABS. A fourth line command, COLS, is used as a reference. COLS displays a column reference. 000008 //SYSIN DD * =COLS> ----+----1----+----2----+-- 000009 LIST.DB DBD(DPH01MD6) DBDS The COLS line cannot be overtyped. It can be removed using the RESET primary or D line command. BNDS displays a line describing the current boundaries. The left bound is marked by a left angle bracket (<), the right bound by a right angle bracket (>). 000400 //STEP01 EXEC PGM=DSPURX00 =BNDS> < > 000500 //STEPLIB DD DSN=IMSVS.GRUP.IMS.RESLIB,DISP=SHR Bounds are changed by changing the location of either or both bound markers. The BNDS line can be removed using the RESET primary or D line command. However, removing the BNDS line does not change the current bounds. The primary command BOUNDS with no operands resets bounds to the default value. The TABS and MASK line commands were discussed under Edit Profiles. Performance note: in a large dataset, deleting individual TABS, MASK, BNDS, or COLS lines is more efficient than the RESET command because all lines are processed under RESET. The MakeData Line Command The MakeData (MD) line command takes some temporary lines (e. g. COLS or NOTE) and converts each line to a data line. MD works on a single line; MDD or MDMD marks blocks of lines to convert to data. To mark the next “X” lines, use MD followed by the number of lines to make into data. MD does not convert the following lines to data: PROF, BNDS, TABS, MASK.
  • 40. 40 Not Your Father’s Editor The ISPF editor is a very powerful tool. In addition to having a great many useful functions, you can build your own in the form of edit macros. This course does not go into detail on how to write edit macros; the advanced ISPF courses do that. I will show you a few macros and explain them as I go; you can then write your own to string many commands together. On the main edit panel, there are a number of fields besides the dataset name entry fields. I never use them unless I absolutely have to for a particular task, but I do want to point out the Initial Macro field. It is possible to start your edit session with a string of commands. For example, you may hate those warning messages that come up every time (“WARNING: the UNDO command will not be available…”). Or, in a PDS, you always turn STATS on. A macro written to start an edit session is called an initial macro. You can specify an initial macro on the EDIT screen, but there is another way. Once you’ve got an edit macro built you can set it “forever” by: 1. ZUSERMAC = 'DFOIMAC' sets the initial edit macro variable to the name of your initial edit macro (mine is DFOIMAC); 2. The ISPEXEC command 'VPUT ZUSERMAC PROFILE' puts the variable into the profile pool so it is always executed. To clear the edit macro use this ISPEXEC command: 'VERASE ZUSERMAC PROFILE'. You must use VERASE because directly editing your ISPF profile could cause problems. Here is a copy of my initial edit macro, with comments: /* REXX */ Address ISREDIT "MACRO" "PROFILE UNLOCK" Unlock the edit profile. "BOUNDS" Reset bounds in case I forgot before. "NULLS ON" Nulls on for freedom of inserting. "HILITE AUTO" HILITE based on file type. "RECOVERY ON" Allow recovery. "AUTOSAVE ON" Save when F3 is pushed. CURMBR = "" "(CURMBR) = MEMBER" Is this a PDS member? If CURMBR <> "" Then “STATS ON” If so, turn on STATS. "RESET" Get rid of all messages. Exit
  • 41. 41 A Few Good Edit Macros • ALLLC convert all characters to lower case. • ALLUC convert all characters to upper case. • CHKPARM copy the selected SYSIN parm as comments into the JCL. • COMMOUT comment out a section of JCL. • DELDUPS delete duplicate records from dataset. • DSU browse, edit, view, delete, or allocate dataset the cursor is on. • HIDE exclude only those lines containing a string. • CENTER center text on a line or group of lines. • PUTPARM copy the selected parm contents to a dataset. • SEEK undo a HIDE command. • XFS exclude all and find a single string, parms allowed. Coding Simple Edit Macros Coding a simple macro is, well, simple. There are three things to remember. 1. The first statement must be ISREDIT MACRO. 2. Arguments are listed in parenthesis after the MACRO statement. Initial edit macros cannot have arguments. 3. You may have an END or CANCEL command in your macro as long as it’s the last statement. Item 3 is important. You can code an edit macro to make a set of changes to a file, then exit, without ever seeing an edit session. Suppose you have JCL created in a generic PDS with the job name coded as “??????T”. You can code an initial edit macro to change that to your user ID, submit the job, and then cancel out of it without saving the changes. Here’s an edit macro to do that. /* REXX IEDMAC */ Address ISREDIT Pass all commands to the editor "MACRO" "CHANGE ??????" Sysvar(SYSUID) Change the job name "SUBMIT" Submit the job "CANCEL" Get out without saving Exit The call to invoke the macro looks like this: ISPEXEC EDIT DATASET(dsn(member)) MACRO(IEDMAC) The call must be in a REXX exec or CLIST; it cannot be executed in TSO. This lets an area create a set of generic JCL to be submitted using commands.
  • 42. 42 “All Together Now:” Full Examples of an Edit Session Let’s bring together some of the concepts we’ve learned about Edit. On the following pages are some examples using the many commands and concepts we’ve learned to do some actually useful things. On this and the next page are some steps we might do to create and run a set of JCL. Here’s an empty member of my JCL PDS after I’ve displayed my profile and run some commands: Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** =PROF> ....CNTL (FIXED – 80)....RECOVERY OFF WARN....NUMBER ON STD............. =PROF> ....CAPS ON....HEX OFF....NULLS ON STD....TABS ON STD................... =PROF> ....AUTOSAVE ON....AUTONUM OFF....AUTOLIST OFF....STATS ON.............. =PROF> ....PROFILE UNLOCK....IMACRO NONE....PACK OFF....NOTE ON................ =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7— =TABS> * =MASK> // DD DISP=SHR,DSN= =BNDS> < > ****** **************************** Bottom of Data **************************** Here are the commands I entered and why I chose them: 1. PROFILE 8 displayed the profile for this PDS, including the TABS, MASK, and BOUNDS lines; 2. TABS ON turns on tab capability; 3. NULLS ON allows me to insert anywhere; 4. NUMBER ON STD provides JCL numbers in columns 73-80; 5. Entered a hardware tab in column 12 (for the DD); 6. Created a mask for “//”, “DD”, and DISP fields, since those are the most common things I use. Notice the BOUNDS are set at 1 and 72. The editor did that because columns 73 – 80 are the line numbers. That makes the line numbers exempt from commands like FIND and CHANGE.
  • 43. 43 Edit Session Example continued Now I enter the RESET command and insert 10 lines: ****** ***************************** Top of Data ****************************** '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= ****** **************************** Bottom of Data **************************** Notice how the mask is propagated? I’ll enter some data, using the tabs and my keyboard’s END key (I set that as end of field) when needed. This is the screen after I’ve typed but before I’ve hit ENTER: ****** ***************************** Top of Data ****************************** '''''' //SP1002ST JOB SP218ZZDFO9999A044,'ODEA 77184',USER=@TSSQ04, '''''' // MSGLEVEL=1,MSGCLASS=H,PRTY=4,NOTIFY=@TSSQ04 '''''' //*FORMAT PR,DDNAME=,DEST=TMNODE1.RM005 '''''' //*MAIN CLASS=TSS04 '''''' //** '''''' //STEP01 EXEC PGM=IEFBR14 '''''' //dd01 DD DSN=@tssq04.junk.data,disp=(mod,delete), '''''' // unit=d,space=(trk,0) '''''' // DD DISP=SHR,DSN= '''''' // DD DISP=SHR,DSN= ****** **************************** Bottom of Data **************************** See how I’ve been able to overlay the mask wherever needed? Here’s the same screen after I hit ENTER: ****** ***************************** Top of Data ****************************** 000100 //SP1002ST JOB SP218ZZDFO9999A044,'ODEA 77184',USER=@TSSQ04, 000200 // MSGLEVEL=1,MSGCLASS=H,PRTY=4,NOTIFY=@TSSQ04 000300 //*FORMAT PR,DDNAME=,DEST=TMNODE1.RM005 000400 //*MAIN CLASS=TSS04 000500 //** 000600 //STEP01 EXEC PGM=IEFBR14 000700 //DD01 DD DSN=@TSSQ04.JUNK.DATA,DISP=(MOD,DELETE), 000800 // UNIT=D,SPACE=(TRK,0) ****** **************************** Bottom of Data **************************** Now we’ll go ahead and submit the job. Since I’ve set up my F12 key as submit;end;tso ej;st I can just hit F12 and I’m off and running. Otherwise I’d have to type SUBMIT, and then hit F3, and then type TSO EJ, and then type ST. Nineteen keys, or one key… you decide.
  • 44. 44 HILITE: an Example Now let’s check out some primary and line commands. Here’s a short REXX exec to illustrate the HILITE command. ****** ***************************** Top of Data ****************************** 000001 /* REXX QUIP program */ 000003 "ALLOC DDNAME(QUIP) DA('DBIG.QUIPS.DATA') SHR REUSE" 000004 QNUM = RANDOM(1,747) 000005 "EXECIO 1 DISKR QUIP" QNUM "(FINIS" 000006 PARSE PULL QUIP; SAY QUIP 000007 "FREE F(QUIP)" ****** **************************** Bottom of Data **************************** In the example bold characters are quoted text (white in Edit), italics are comments (cyan), and underlined characters are “keywords” (red), used for highlighting logic, language verbs, and so on. You can see how this might be useful. Notice on Line 4 the “QNUM” variable is not in the quotes and is not highlighted. If QNUM were supposed to be part of the command and not a variable you would expect it to be highlighted as is the rest of the command. Let’s change this a bit. I’ll drop the “*/” from the comment and remove one of the quotes. Let’s see what happens. ****** ***************************** Top of Data ****************************** 000001 /* REXX QUIP program 000003 "ALLOC DDNAME(QUIP) DA('DBIG.QUIPS.DATA') SHR REUSE 000004 QNUM = RANDOM(1,747) 000005 "EXECIO 1 DISKR QUIP" QNUM "(FINIS" 000006 PARSE PULL QUIP; SAY QUIP 000007 "FREE F(QUIP)" ****** **************************** Bottom of Data **************************** Not what we expected, is it? Without the closing “*/” Rexx thinks the entire code is a comment. Highlighting is smart enough to catch this. Let’s put the “*/” back (but leave the quotes off) and see what happens. ****** ***************************** Top of Data ****************************** 000001 /* REXX QUIP program */ 000003 "ALLOC DDNAME(QUIP) DA('DBIG.QUIPS.DATA') SHR REUSE 000004 QNUM = RANDOM(1,747) 000005 "EXECIO 1 DISKR QUIP" QNUM "(FINIS" 000006 PARSE PULL QUIP; SAY QUIP 000007 "FREE F(QUIP)" ****** **************************** Bottom of Data **************************** All the red is gone. The strings are quoted, so they’re no longer considered REXX verbs. Note the left parenthesis next to “FINIS”; it’s pink! Highlighting is expecting a matching right parenthesis because the left parenthesis is no longer quoted. Unmatched parentheses are an error, so this one is highlighted even though it’s perfectly legal in REXX.
  • 45. 45 Sort, Exclude, and Bounds We talked separately about using the SORT command, excluding lines, and setting bounds. Let’s combine those concepts. Here’s a dataset with information in columns: Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 NAME HR NAME HR NAME HR 000002 BONDS 49 HELTON 46 SOSA 51 000003 HELTON 46 SOSA 51 PALMIERO 48 000004 THOME 52 PALMIERO 48 GARCIAPARRA 30 000005 000006 NAME HR NAME HR NAME HR 000007 THOMAS 26 BAGWELL 34 KONERKO 38 000008 THOMAS 26 BURNITZ 38 BAGWELL 34 000009 BURNITZ 32 KONERKO 38 KOSKIE 16 ****** **************************** Bottom of Data **************************** Suppose we want to sort all three columns into HR order. There’s no obvious way to do this and still preserve the separate order each column deserves. Using “sort 16 17 a 38 39 a 60 61 a” results in: Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 000002 NAME HR NAME HR NAME HR 000003 NAME HR NAME HR NAME HR 000004 THOMAS 26 BAGWELL 34 KONERKO 38 000005 THOMAS 26 BURNITZ 38 BAGWELL 34 000006 BURNITZ 32 KONERKO 38 KOSKIE 16 000007 HELTON 46 SOSA 51 PALMIERO 48 000008 BONDS 49 HELTON 46 SOSA 51 000009 THOME 52 PALMIERO 48 GARCIAPARRA 30 ****** **************************** Bottom of Data **************************** We know that’s not right. The header and spacer lines have percolated to the top and we’ve lost our data integrity. What can we do? Somehow we have to ignore the lines we don’t want to sort.
  • 46. 46 Sort, Exclude and Bounds continued Let’s take the original data and apply the exclude line command (“X”) to mark those lines we want sorted: Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 NAME HR NAME HR NAME HR - - - - - - - - - - - - - - - - - - - 3 Line(s) not Displayed 000005 000006 NAME HR NAME HR NAME HR - - - - - - - - - - - - - - - - - - - 3 Line(s) not Displayed ****** **************************** Bottom of Data **************************** Now we’ll try the same sort, this time using the “X” operand on the SORT, making the command sort x 16 17 a 38 39 a 60 61 a: Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 NAME HR NAME HR NAME HR 000002 THOMAS 26 BAGWELL 34 KONERKO 38 000003 THOMAS 26 BURNITZ 38 BAGWELL 34 000004 BURNITZ 32 KONERKO 38 KOSKIE 16 000005 000006 NAME HR NAME HR NAME HR 000007 HELTON 46 SOSA 51 PALMIERO 48 000008 BONDS 49 HELTON 46 SOSA 51 000009 THOME 52 PALMIERO 48 GARCIAPARRA 30 ****** **************************** Bottom of Data **************************** As Bullwinkle said, “Well, I’m getting close,” but it’s not good enough. Players have switched teams and still only the first column is close to the proper order. How do we do this? An obvious solution is to “X” out those lines we want sorted, a section at a time, and then sort only that section. The result of that is: Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 NAME HR NAME HR NAME HR 000002 HELTON 46 SOSA 51 PALMIERO 48 000003 BONDS 49 HELTON 46 SOSA 51 000004 THOME 52 PALMIERO 48 GARCIAPARRA 30 000005 000006 NAME HR NAME HR NAME HR 000007 THOMAS 26 BAGWELL 34 KONERKO 38 000008 THOMAS 26 BURNITZ 38 BAGWELL 34 000009 BURNITZ 32 KONERKO 38 KOSKIE 16 ****** **************************** Bottom of Data **************************** Much better, but still not right. While players haven’t switched teams and the headers are still there, the sort order is still wrong.
  • 47. 47 Sort, Exclude and Bounds continued The first thought is to split the sort into three sorts. The result is still going to be records not in sort order because, no matter what, the highest-order sort controls the record order. Does this have to be done manually? Not at all! What we have here, after line exclusion and sorting all the fields at once, is a file with the left-most of three columns in the correct order. Using bounds in conjunction with exclusion and sorting will accomplish what we want. Remember, SORT works within boundaries only. Here again is our data, sorted after using exclude and sort (sort x 16 17 a) so the first column is correct. This time I’ve included a BNDS line command to limit the next sort to the center column: Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** =BNDS> < > 000001 NAME HR NAME HR NAME HR 000002 HELTON 46 SOSA 51 PALMIERO 48 000003 BONDS 49 HELTON 46 SOSA 51 000004 THOME 52 PALMIERO 48 GARCIAPARRA 30 000005 000006 NAME HR NAME HR NAME HR 000007 THOMAS 26 BAGWELL 34 KONERKO 38 000008 THOMAS 26 BURNITZ 38 BAGWELL 34 000009 BURNITZ 32 KONERKO 38 KOSKIE 16 ****** **************************** Bottom of Data **************************** Now we’ll re-exclude the lines and sort as we did the first time (hopefully you remember to use the RETRIEVE key), the command being sort x 38 39 a. The result of this second sort is: Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** =BNDS> < > 000001 NAME HR NAME HR NAME HR 000002 HELTON 46 HELTON 46 PALMIERO 48 000003 BONDS 49 PALMIERO 48 SOSA 51 000004 THOME 52 SOSA 51 GARCIAPARRA 30 000005 000006 NAME HR NAME HR NAME HR 000007 THOMAS 26 BAGWELL 34 KONERKO 38 000008 THOMAS 26 BURNITZ 38 BAGWELL 34 000009 BURNITZ 32 KONERKO 38 KOSKIE 16 ****** **************************** Bottom of Data **************************** We’ll now repeat the same procedure sorting on columns 60 and 61. The result is on the next page.
  • 48. 48 Sort, Exclude, and Bounds continued Here’s the result: Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** =BNDS> < > 000001 NAME HR NAME HR NAME HR 000002 HELTON 46 HELTON 46 GARCIAPARRA 30 000003 BONDS 49 PALMIERO 48 PALMIERO 48 000004 THOME 52 SOSA 51 SOSA 51 000005 000006 NAME HR NAME HR NAME HR 000007 THOMAS 26 BAGWELL 34 KOSKIE 16 000008 THOMAS 26 BURNITZ 38 BAGWELL 34 000009 BURNITZ 32 KONERKO 38 KONERKO 38 ****** **************************** Bottom of Data **************************** In order, the steps to follow are: 1. Determine your sort fields; 2. Set appropriate bounds using the BNDS line command; 3. Exclude the lines you want sorted using the X/XX line command; 4. Code your sort command as SORT X <start> <end> a/d;RES X; 5. Return to number 2. and continue until you’re done sorting. If you’re sorting in ascending order with only one field, you can leave off the “a”. The “;RES X” on the end of the command resets the excluded lines to get ready for the next exclude line commands. Don’t forget to use the RETRIEVE key to relieve strain on your carpal tunnel. When you’re done with this sort of process, you’ll want to execute the BOUNDS primary command to reset any bounds you changed back to the defaults. If you don’t you may end up surprised.
  • 49. 49 Miscellaneous Edit Trick On a dataset entry field you can limit the PDS member name list to certain members using wildcards. We talked about them before; here’s a practical example. To see only those members starting with ACB, on the main Edit screen you can enter (see bold): Menu RefList RefMode Utilities Workstation Help ------------------------------------------------------------------------------ Edit Entry Panel Command ===> ISPF Library: Project . . . @TSSQ04 Group . . . . SN1 . . . . . . . . . Type . . . . CNTL Member . . . acb* (Blank or pattern for member selection list) Other Partitioned, Sequential or VSAM Data Set: Data Set Name . . . Volume Serial . . . (If not cataloged) Workstation File: File Name . . . . . Options Initial Macro . . . . Confirm Cancel/Move/Replace Profile Name . . . . . Mixed Mode Format Name . . . . . Edit on Workstation Data Set Password . . Preserve VB record length This can be done anywhere you enter a dataset name, including on the DSLIST panels (see the DSLIST section below). The entire member list is always accessible. In the case above you could select another member to edit, even if its name is not listed on the member list, as long as the member is in the PDS.
  • 50. 50 Miscellaneous ISPF Tricks Use member masks to create any member list. Normally you’ll see a list of members with selection fields to the left, and sometimes a PROMPT field to the right. In the PROMPT field you can enter parameters to be passed to certain line commands. Member lists can have three types of selection fields: 1. A single dot indicates only one member can be processed at a time using a single command (usually “S”); 2. A single underscore indicates only one member can be processed at a time, using multiple function commands (e. g. “S”, “E”, “R”, etc.); 3. A line of underscores indicates many members can be processed using multiple function commands. In member lists with underscores, you can select a list of members to pass to a line command. The result is as if you entered separate line commands. For example, to edit all ACB* members in a PDS, use this command: COMMAND ===> s ACB* e where “e”, edit, is the command being passed. This can also be done in the COPY function (option 3.3). To copy or move members from one PDS or another you can enter a member name mask. You may be tempted to type the “S” in each selection field. To reduce strain on your fingers type “S *” on the command line instead. Use the PC’s copy and paste functions to rename members in a PDS. For example, to rename the ACB* members to ARB* members: LIBRARY @TSSQ04.SN1.CNTL Row 00001 of 00092 Command ===> Scroll ===> CSR Name Prompt Size Created Changed ID R ACBJCL ArBJCL 58 2002/09/23 2002/09/23 11:30:37 @TSSQ04 R ACBJCLT ArBJCLT 47 2002/09/23 2002/10/09 09:42:25 @TSSQ04 R ACBSYSIN ArBSYSIN 13 2002/09/23 2002/11/04 15:35:05 @TSSQ04 For this example I typed “R” next to the members I wanted to rename, copied the member names, and then pasted them into the PROMPT field. Then I overtyped the “C” to be “r” and hit ENTER. For a few members this works well. If you have many members, though, you may not want to do things this way. I have a REXX exec designed to rename all members in a PDS. If you’re interested you can have it.