These series of commands demonstrates the use of table services:
- 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 tableAA |
BB |
CC |
---|
|
|
|
- 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)
- 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 variablesAA |
BB |
CC |
---|
Pauly John |
W590 |
Jones Beach |
- 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
variablesAA |
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.
- 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.