Open EXTEND of Nonexistent File

Solution:

Several solutions are available:

  • Add the keyword OPTIONAL to the SELECT statement. This makes this COBOL system create the file and open it for OUTPUT.
  • Create the file, empty, before running your program.
  • Specify the OPTIONALFILE directive. This makes this COBOL system create the file and open it for OUTPUT. However, the behavior with files opened for I-O will now differ from RM/COBOL.