Multiple choice technology programming languages

Which mode of opening is required when REWRITE is used?

  1. INPUT

  2. OUTPUT

  3. I-O

  4. EXTEND

  5. All of the above

  6. None of the above

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

The REWRITE verb in COBOL requires the file to be opened in I-O (Input-Output) mode. This is because REWRITE reads an existing record and then writes it back in the same position - it needs both read and write access. INPUT mode only allows reading, OUTPUT mode only allows writing new records, and EXTEND mode only adds records at the end.