Relative Files

If the access mode is sequential, the last input/output statement that was executed for the file must have been a successful READ statement. The record to be replaced is the record that was retrieved by that statement. The INVALID KEY and NOT INVALID KEY phrases must not be specified. An EXCEPTION/ERROR procedure may be specified.

If the access mode is random or dynamic, the record to be replaced is specified by the value in the RELATIVE KEY data-item. If the file does not contain such a record, then an INVALID KEY condition exists. An INVALID KEY phrase should be specified if no EXCEPTION/ERROR procedure has been defined for the file.

For files with relative organization, the number of characters in record-name-1 can be different from the number of character positions in the record being replaced.