z/OS ISPF Services Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


TBMOD—modify a row in a table

z/OS ISPF Services Guide
SC19-3626-00

The TBMOD service unconditionally updates a row in a table.

For tables with keys, the table is searched for the row to be updated. The current contents of the key variables, dialog variables that correspond to keys in the table, are used as the search argument. If a match is found, the row is updated. If a match is not found, a TBADD is performed, adding the row to the end of the table (or it is added at an appropriate point for maintaining the table) in the sequence specified in a previously processed TBSORT request.

For tables without keys, TBMOD is equivalent to TBADD. This processing takes place: any new row is added either immediately following the current row, pointed to by the current row pointer (CRP), or it is added at a point appropriate for maintaining the table in the sequence specified in a previously processed TBSORT request.

The CRP is always set to point to the row that was updated or added.

The current contents of all dialog variables that correspond to columns in the table, keys and names, are saved in the row.

Additional variables, not specified when the table was created, can also be saved in the row. These "extension" variables apply only to this row, not to the entire table. Whenever the row is updated, the extension variables must be specified again if they are to be rewritten.

When the TBMOD service uses the TBADD service to add rows to a table, the default value for number-of-rows parameter of the MULT keyword for TBADD can affect TBMOD execution. See the description of the TBADD service for information.

Command invocation format

Read syntax diagramSkip visual syntax diagram
>>-ISPEXEC--TBMOD--table-name--+-----------------+--+-------+--><
                               '-SAVE(name-list)-'  '-ORDER-'   

Call invocation format

Read syntax diagramSkip visual syntax diagram
>>-CALL--ISPEXEC--(buf-len,--buffer);--------------------------><

or

Read syntax diagramSkip visual syntax diagram
>>-CALL--ISPLINK--('TBMODbbb'--,--table-name--,-+-name-list-+--->
                                                '-'b'-------'   

>--+-'ORDERbbb'-+--);------------------------------------------><
   '-'b'--------'       

Parameters

table-name
Specifies the name of the table to be updated.
name-list
Specifies a list of extension variables, by name, that are to be saved in the row, in addition to the variables specified when the table was created.
ORDER
Specifies that any new row is to be added or inserted in the order specified in the sort information record. A TBSORT must have been performed for this table before use of this keyword. For tables with keys, the row is updated and then reordered if necessary. If a match is not found or the table does not have keys, the row is added at a point appropriate for maintaining the table in the sequence specified by the sort information record. This keyword is ignored if the table has never been sorted. If this keyword is omitted, any existing sort information record is nullified.

When a newly inserted row has sort field-names equal to the sort field-names of an existing row, the insertion is made after the existing row.

buf-len
Specifies a fullword fixed binary integer containing the length of "buffer".
buffer
Specifies a buffer containing the name of the service and its parameters in the same form as they would appear in an ISPEXEC call for a command procedure.

Return codes

These return codes are possible:
 0
Normal completion. Keyed tables: Existing row updated. Non-keyed tables: New row added to table.
 8
Keys did not match; new row added to the table. Returned only for tables with keys.
12
Table is not open.
16
Numeric conversion error; see numeric restrictions for TBSORT. Returned only for sorted tables.
20
Severe error.

Example

Update or add a row of variables in the table TELBOOK using values from variables in the function variable pool.
ISPEXEC TBMOD TELBOOK
Set the program variable BUFFER to contain:
TBMOD TELBOOK
Set program variable BUFLEN to the length of the variable BUFFER. Issue the command:
CALL ISPEXEC (BUFLEN, BUFFER);
or alternately
CALL ISPLINK ('TBMOD   ','TELBOOK ');

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014