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.
UPDATE
TBL=(table name) |
Required keyword WITH and/or |
Action
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.
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.