Multiple choice technology mainframe

For successful execution of REWRITE stmt, the direct access file must be opened in _____ mode.

  1. I

  2. O

  3. I-O

  4. O-I

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

The REWRITE statement in COBOL updates a record in a file, and requires the file to be opened in I-O (Input-Output) mode. I-O mode allows both reading and writing operations on the same file, which is necessary because REWRITE must first read the record (implicitly or explicitly) and then rewrite the updated version.