RPG/400 Help

UPDAT (Modify Existing Record)

*---------*---------------*-----------------*----------------*---------------*
|   CODE  |    FACTOR 1   |     FACTOR 2    |     RESULT     |  INDICATORS   |
|         |               |                 |      FIELD     |               |
*---------*---------------*-----------------*----------------*---------------*
| UPDAT   |               | File name       | Data           |     _ ER _    |
|         |               |                 | structure      |               |
*---------*---------------*-----------------*----------------*---------------*

The UPDAT operation modifies the last record retrieved for processing from an update disk file or subfile. No other operation should be performed on the file between the input operation that retrieved the record and the UPDAT operation.

Factor 2 must contain the name of a file or record format to be updated. A record format name in factor 2 is required with an externally described file. The record format name must be the name of the last record read from the file; otherwise, an error occurs. A file name in factor 2 is required with a program described file.

The result field must contain a data structure name if factor 2 contains a file name. The updated record is written directly from the data structure to the file. The result field must be blank if factor 2 contains a record format name.

You can specify a resulting indicator in positions 56 and 57 to be set on if the UPDAT operation is not completed successfully.

Remember the following when using the UPDAT operation:


[ Top of Page | Previous Page | Next Page | Table of Contents ]