z/OS ISPF Dialog Developer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example: create and update a simple table

z/OS ISPF Dialog Developer's Guide and Reference
SC19-3619-00

These series of commands demonstrates the use of table services:

  1. Create a permanent table, named DALPHA, to consist of dialog variables AA, BB, and CC. AA is the key field. BB and CC are name fields.
    ISPEXEC TBCREATE DALPHA KEYS(AA) NAMES(BB CC) WRITE
    Table 1. Sample table
    AA BB CC
         
  2. Display a panel named XYZ. This panel prompts a user to enter values for dialog variables AA, BB, and CC, which are used in the steps of this example.
    ISPEXEC DISPLAY PANEL (XYZ)
  3. Assume the user enters these values on panel XYZ:
    AA = Pauly John
    BB = W590
    CC = Jones Beach
    ISPF automatically updates dialog variables AA, BB, and CC, in the function variable pool, with the user-entered values.

    Record these values in the table DALPHA.

    ISPEXEC TBADD DALPHA
    Table 2. Sample table with dialog variables
    AA BB CC
    Pauly John W590 Jones Beach
  4. Assume these values for dialog variables AA, BB, and CC are entered by a user, as in step 3, through a panel display operation:
    AA = Clark Joan
    BB = Y200
    CC = Bar Harbor

    Record these values in the table DALPHA.

    ISPEXEC TBADD DALPHA
    Table 3. Sample table with user dialog variables
    AA BB CC
    Pauly John
    Clark Joan
    W590
    Y200
    Jones Beach
    Bar Harbour

    Table services adds a row to table DALPHA immediately following the row added by the previous TBADD. Following the TBADD, the current row pointer (CRP) is positioned at the newly added row. Before a row is added by the TBADD service, table service scans the table to determine if the KEY field of the new row to be added duplicates the KEY field of an existing row. If it does, the TBADD is not performed.

  5. Save table DALPHA for later use by writing it to the table output library.
    ISPEXEC TBCLOSE DALPHA

    The table DALPHA is written from virtual storage to the file specified by ISPTABL.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014