UPDATE, UPDATAB (FILELIST)


 

The UPDATE instruction modifies a record in place. Any changes to the keys of secondary files are automatically updated.

 

 

[label]

UPDATE

{filelist};{list}

 

Where:

label

Optional. A Program Execution Label.

filelist

Required. A previously defined and opened FILELIST variable defining the primary and secondary files in which data is updated.

list

Required. Any combination of previously defined Character String Variables, Numeric Variables, string or numeric ARRAYS, individual array elements, VARLISTs of string or numeric variables, or valid Disk I/O List Controls.

Flags Affected: OVER

Note the following:

  1. The instruction requires that the last read operation on any one of the FILELIST files must have been a valid read operation.

  2. The instruction will update all keys of the ISAM or AAM files defined in the FILELIST that are changed by the {list} variables.

    WARNING: When the update changes the key for an ISAM file in the FILELIST, the current key pointer for this ISAM file is changed to the new key position in the ISI tree. Therefore, any READKS or READKP instruction for an IFILE in the FILELIST whose key has been changed reads the key sequential record relative to the new key pointer position. 

  3. The instruction operation will synchronize the primary file to the last valid FILELIST file read and update the text data record.

  4. Should an error occur for any part of the operation, the runtime attempts to restore the old record and associated keys to their original state prior to the operation.

  5. All other aspects of the UPDATE instruction are defined in the UPDATE AFILE or UPDATE IFILE topics.

  6. When the FILELIST files have been opened for record locking and the SINGLE record locking mode is used, the UPDATE FILELIST instruction searches all of the files in the FILELIST to release the record lock from the file that performed the last READ operation. The record lock is only released for the record that was just updated.

 

 

See Also: Example Code, READ (FILE), WRITE (FILELIST), Disk I/O Instructions

 



PL/B Language Reference UPDATE, UPDATAB (FILE) UPDATE, UPDATAB (IFILE)