UPDATE command

The UPDATE command updates a table using data from a sequential dataset. Two files are available: one for adds and changes, and the other for deletes.


TBL=(table name)
TTYPE=(table name conversion – blank/V)
LIB=(library name)
GEN=(generation number)
PSWD=(write password);

Required keyword

WITH and/or
REMOVE are required


The key of the record is assumed to be in the same position as the key in the table.

For each record on the REMOVE file, the table will be searched for a row with a matching key and if found the row will be deleted.

For each record on the WITH file, if the key is matched in the table, the corresponding entry will be replaced in its entirety by the data record. If the key is not matched, the data record will be inserted in the table.

Only the first row found on the table with a key matching and input record will be updated or removed.

If both WITH and REMOVE keywords are present, the rows are inserted/replaced before the REMOVE rows are deleted.

All actions taken during the UPDATE command are logged on the TBRPT file.