Example: function using the DISPLAY, TBGET, and TBADD services

This topic describes the use of the DISPLAY, TBGET, and TBADD services in a dialog function that allows a user to add data to a table. A user can start the function by using the ISPSTART command. If the user has already started ISPF, the function can be started from:

  • A menu
  • The command field in any display with an application command that is defined in the current command table to have the SELECT action
  • Another function by using the SELECT service
During function processing, the DISPLAY service controls displays requesting the user to enter data about new employees. The data consists of:
  • Employee serial number, entered on panel SER
  • Name and phone number, entered on panel DATA.
Entered information is added to the table, as a row, through the TBADD service.

If the user enters an employee serial number for which an employee record already exists in the table, a DUPLICATE NUMBER short message displays on line 1 of panel SER. If the user enters the HELP command or presses the HELP Function key to get further explanation of this short message, this long message is displayed on line 3 of the panel:

EMPLOYEE RECORD ALREADY EXISTS FOR THIS NUMBER. ENTER ANOTHER

When the user successfully enters data for an employee, the short message NEW RECORD INSERTED is displayed on line 1 of panel SER. Then the user can enter the serial number of the next employee for which table data is to be added.

The user ends function processing by entering the END or RETURN command on any displayed panel or by pressing the END Function key or RETURN Function key.

Command procedure function lists the complete function, followed by each statement with supporting text and figures.