To modify records in a file using REWRITE or DELETE statements, you must open the file in I-O (Input-Output) mode. OUTPUT mode creates new files, EXTEND adds records to the end, and INPUT only allows reading.
To rewrite or delete existing records in a file, COBOL requires the file to be opened in I-O (Input-Output) mode, since that mode allows both reading and updating/removing existing records in place. OUTPUT mode is for writing new records to an empty file, EXTEND is for appending, and INPUT only allows reading — none of these permit rewriting or deleting existing records.