Multiple choice technology programming languages

Which of the following is true about the file which is referenced in a DELETE statement?

  1. It must be opened in INPUT mode

  2. It must be opened in OUTPUT mode

  3. It must be opened in I-O mode

  4. As in the case of SORT statement, the file must be closed before the use of this statement

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

The DELETE statement in COBOL requires the file to be opened in I-O mode. I-O mode allows both reading and writing operations, which is necessary for delete operations. INPUT mode only allows reading, OUTPUT mode only allows writing new records, neither supports deletion of existing records.