The ISPF tutorial panels

A tutorial panel is a special type of panel that is processed by the ISPF tutorial program. This program invokes the panel display service to display the panel.

A user invokes the ISPF program that displays tutorial panels in four ways:

Transfer into and out of the tutorial using the HELP command is transparent (no action required) to ISPF functions.

ISPF tutorial panels are arranged in a hierarchy. Generally, this hierarchy is a table of contents, each succeeding level of which contains a more detailed list of topics. When the tutorial is entered from a menu, the first panel to be displayed is usually the top of the hierarchy. The name of the first panel is passed as a parameter to the ISPTUTOR program.

When the tutorial is entered by use of the HELP command, the first panel to be displayed is a panel within the hierarchy, appropriate to what you were doing when help was requested.

When viewing the tutorial, you can select topics by entering a selection code or by simply pressing Enter to view the next topic. On any panel, you can also enter these commands:

BACK or B
To return to the previously viewed panel
SKIP or S
To advance to the next topic
UP or U
To display a higher-level list of topics
TOC or T
To display the table of contents
INDEX or I
To display the tutorial index
Note: If you enter the UP command after viewing a portion of a tutorial sequentially and if you do not select a new topic from the displayed list, you can resume the tutorial at the next sequential topic on the list by entering the NEXT command or by pressing Enter.
You can use these keys whenever you are in the tutorial:
ENTER
To display the next sequential page or scroll a scrollable help panel
HELP
To redisplay this page for help information
END
To terminate the tutorial
UP
To display a higher level list of topics (rather than typing UP)
DOWN
To skip to the next topic (rather than typing SKIP)
RIGHT
To display the next page (rather than pressing Enter) or to scroll a scrollable help panel
LEFT
To display the previous page (rather than typing BACK) or to scroll a scrollable help panel
When running under tutorial and trying to scroll past the end of the scrollable area, a message will be displayed indicating that no more information is available in the scrollable area. If RIGHT or ENTER is pressed again, ISPF will follow the normal tutorial flow and display the next help panel if one has been defined. The same is true when scrolling to the TOP of the scrollable AREA; a message indicating that no more information is available will be displayed, and if LEFT is pressed, the previous tutorial panel will be displayed if one has been defined.

Cursor positioning usually defines which scrollable area will be scrolled. However, when in tutorial, if the cursor is not within a scrollable area, the first area defined in the )BODY section will be scrolled. The LEFT and RIGHT commands should be included in any keylist specified for a scrollable help panel.

If you issue the HELP command while viewing a tutorial, ISPF displays a tutorial panel that contains a summary of commands that are available to the tutorial user.

When you end the tutorial, using the END or RETURN command, the panel from which you entered the tutorial is displayed again.

The name of the top panel must be specified by dialog variable ZHTOP. The name of the first index panel must be specified by ZHINDEX. It is recommended that these two dialog variables be initialized at the beginning of the application to ensure that the user can always display the tutorial top or index, regardless of how the tutorial was entered. One way to initialize these variables is to set them from the primary option menu, as shown in Example of a primary option menu.

The index is optional. It is a collection of panels in which topics are arranged in alphabetical order. You can jump to the index from any point by using the INDEX command. The index need not be connected to the main tutorial hierarchy. It can be a topic that you can select from the main table of contents or other panels. A list of the last 20 tutorial panels displayed, including the current panel, is maintained by ISPF. You should issue the TOP or INDEX command instead of the BACK command if you want to view panels displayed before the last 20 panels.

Each tutorial panel must have a next selection input field. Generally, you should use the name ZCMD for this field. A tutorial panel should also have a processing section in which these variables are set:
ZSEL or SEL
Specifies the name of the next panel to be displayed based on the topic selected by the user, by translating ZCMD to a panel name. The panel name can be preceded by an asterisk (*) to indicate a topic that can be explicitly selected by the user, but which is bypassed if the user presses Enter to view the next topic.

The maximum number of entries allowed is 100.

If a panel does not have any selectable topics, omit ZSEL.

ZUP or UP
Specifies the name of the parent panel from which this panel was selected. Generally, ZUP can be omitted since the tutorial program remembers the sequence of selections that lead to the display of this panel. ZUP is used only if this panel is the first to be displayed by a user entering the HELP command, or if it is selected from the tutorial index and the user then enters the UP command.

ZUP is ignored when it is defined in the top panel (defined by ZHTOP).

ZCONT or CONT
Specifies the name of the next continuation panel. If there is no continuation panel, ZCONT should be omitted.
ZIND
When set to a value of YES, specifies that a page in the tutorial is an index page. For example:
)PROC
  &ZIND = YES

The ZIND variable is used only on index pages; it should not be set on other tutorial panels.

Use variable names ZSEL, ZUP, and ZCONT. Variables SEL, UP, and CONT are provided only for compatibility with the previous SPF product.

A panel cannot have both a continuation panel and selectable topics. However, the last panel in a sequence of continuation panels can have selectable topics.

Help/tutorial panels can contain variables so that dialog information, including information entered by a user, can be displayed on the help panel. Function variables, as well as shared and profile variables, can be displayed.

Figure 1 shows a sample hierarchy of tutorial panels. Panels A and B have three selectable topics each. Panels C and D2 have two selectable topics each. The other panels have no selectable topics. Panel D1 has a continuation page (D2), and panel F1 has two continuation pages (F2 and F3).

In Figure 1, assuming that panel A is the highest-level table of contents, the viewer can get to A from any point by issuing the TOC command. A viewer currently on panel F1, F2, or F3 can return to panel B by issuing the BACK command. Then, from B, the SKIP command would take the viewer to panel C. If the user enters the TUTOR command along with a panel identifier parameter, a specific tutorial panel within the Help hierarchy is displayed. From that point on, any movement within the hierarchy is the same as if the user had reached the panel by any other means.

Figure 1. Sample tutorial hierarchy
This is an hierarchical structure. A is at the top of the structure. The next level has B, C and D1 (which leads to D2). At the third level, under B are E, F1 (F2 and F3), and G, under C are H and I, and under D2 are J and K.

Two sample tutorial panels are shown in Figure 2 and Figure 3. These are assumed to be panels B and F2, respectively, in the hierarchy in Figure 1.

Figure 2. Sample tutorial panel definition (panel B)
 %TUTORIAL ------------------ 3270 DISPLAY TERMINAL --------------------TUTORIAL
 %NEXT SELECTION ===>_ZCMD                                                     +
+
 %                     -----------------------------------
                       |       General Information       |
                       |         3270 Key Usage          |
                       -----------------------------------
 +
    The IBM 3270 display terminal has several keys which will assist you
    in entering information.  These are hardware defined keys; they do not
    cause a program interruption.
+
    The following topics are presented in sequence,
    or can be selected by number:
+
      %1+ Insert and Delete Keys
      %2+ Erase EOF (to End-of-Field) Key
+
    The following topic will be presented only if
    explicitly selected by number:
+
      %3+ New Line and TAB Keys
+
 )PROC
   &ZSEL = TRANS(&ZCMD  1,E  2,F1  3,*G  *,'?')
   &ZUP  = A
 )END

Panel B has three selectable topics. In the processing section, ZCMD is translated to a panel name (E, F1, or G) corresponding to the selected option, and the result is stored in ZSEL. If none of the valid options is selected, a question mark (?) is returned as the translated string, which causes the tutorial program to display an invalid option message.

Note that option 3 is translated to *G. This indicates that panel G is displayed if the user selects option 3, but is bypassed if the user repeatedly presses Enter to view each topic. The order in which topics are presented when Enter is pressed is the same as the order in which they appear in the TRANS function. If option 3 is selected, pressing the Enter key does not display the other topics.

In panel B, the name of the parent panel (A) is stored in variable ZUP.

Figure 3. Sample tutorial panel definition (panel F2)
 %TUTORIAL -------------------- ERASE EOF KEY ------------------- TUTORIAL
 %NEXT SELECTION ===>_ZCMD                                                     +

 +
    When the erase EOF (erase to end-of-field) key is used, it will appear
    to blank out the field.  Actually, null characters are used in erasing
    to the next attribute byte, thus making it easy to use the insert
    mode, which requires null characters.
 +
    If the erase EOF key is pressed when the cursor is not within an input
    field, the keyboard will lock.  Press the RESET key to unlock the
    keyboard.
 +
    You can try out the erase EOF key by entering data on line 2, then
    moving the cursor back over part or all of the data and pressing the
    key.
 +
                         (Continued on next page)
 +
 )PROC
   &ZCONT = F3
 )END

Panel F2 (Figure 3) has no selectable topics, but does have a continuation page. The name of the continuation panel (F3) is stored in variable ZCONT. The name of the parent panel (B) could have been stored in ZUP, but this was omitted assuming that F2 cannot be directly entered by use of the HELP command or from the tutorial index.

If you call ISPTUTOR from an edit macro, be sure to save and restore the environment at that point. For example:
ISREDIT MACRO
ISPEXEC CONTROL DISPLAY SAVE
ISPEXEC SELECT PGM(ISPTUTOR) PARM(panel-id)
ISPEXEC CONTROL DISPLAY RESTORE
EXIT