Example—using the TBDISPL and TBPUT services

This topic describes the use of the TBDISPL and TBPUT services in a dialog that displays rows of a table for possible modification by a user.

This dialog invokes the TBDISPL service to display a table named TAB1 with a panel named PAN1. The )BODY section of the panel definition corresponds to the fixed (non-scrollable) portion of the display. The )MODEL section of the panel definition corresponds to the scrollable portion of the display. This is where the table rows are displayed. The "model lines" in the )MODEL section are replicated enough times to fill the screen. Each of these replications is known as a model set, and corresponds to a row of the table. The fields in the model sets correspond to table columns.

Changes the user wishes to make in TAB1 are entered on the display directly into fields in the model sets. When the user enters data into a model set, the corresponding table row is said to be selected for processing.

After the user selects one or more rows, the TBDISPL service locates the first selected row and retrieves it. To retrieve a row means to position the CRP to that row, read it, and then store the row values into the function pool. Next, values from the changed model set are stored in the function pool.

The dialog function then invokes the TBPUT service to write the updated function pool variables to the table row. A user can also enter data, such as function commands, into the fixed portion of the display.

The user ends the dialog by entering the END or RETURN command.

This example does not illustrate:
The function can be started by a user at a terminal by the ISPSTART command. If the user has already started ISPF, the function can be started from:

What follows is first a listing of the complete function, followed by each statement repeated, with supporting text and figures.