When using the WRITE verb in COBOL, what happens if the file is not open in OUTPUT or I-O mode?

  • It results in a runtime error
  • The WRITE operation is ignored
  • The WRITE operation proceeds, and the file is automatically opened in OUTPUT mode
  • The compiler generates an error
If the file is not open in OUTPUT or I-O mode when using the WRITE verb, the compiler generates an error. It is essential to ensure that the file is opened in an appropriate mode before performing WRITE operations.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *