You read a record and, in trying to rewrite it, provided a record in your output item with a key of reference whose value differed from that in the original record. You cannot use the REWRITE statement to replace a record if you change the value of the key of reference.
The term key of reference means the key (that is, certain positions within the record) that was used for the sequential or direct retrieval of the record that was read. The term keyid means the relative position of the start-end pair for this key within the start-end pairs listed in the KEYS specifier on the OPEN statement.
If neither the ERR nor the IOSTAT specifier is present on the I/O statement, the condition is signaled. If the condition is unhandled, the application is terminated.
Qualifying Data: The basic set of four qualifying data for I/O conditions as shown in Table 1. Within this basic set, statement has a value of REWRITE, and parm_count has a value of 6. In addition, there are these qualifying data:
No. | Name | Input/ Output | Data Type and Length | Value |
---|---|---|---|---|
5 | record-desc | Input | Q_DATA_DESC | The q_data descriptor for record. It contains the data type and the length of record. |
6 | record | Input | CHARACTER*n | The record. The length n is part of record-desc. |
Name | Action Taken after Resumption |
---|---|
RN | The remainder of the input item list is ignored, and execution continues. |
If you want to add a new record with a key value that doesn't already exist in the file, then use the WRITE statement to add it.
FOR1100