Multiple choice technology mainframe

In what mode the file should be OPENed to Rewrite/ Delete records in a File?

  1. OUTPUT

  2. EXTEND

  3. I-O

  4. INPUT

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

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.

AI explanation

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.