Problem:
The file-control paragraph specifies the file as follows:
select dataFile assign 'datafile.dat'
Resolution:
The default "file-control-entry" in a COBOL program (the select statement) specifies an optional file. Such a file may or may not be present when a program attempts to open the file.
When an optional file is not present at the time an open i-o statement is executed, a file status of "05" is returned and an empty file is created. When an optional file is present at the time an open i-o statement is executed, a file status of "00" is returned.
In this way you can determine whether you are processing a new, empty data file (file status = "05") or an existing data file (file status = "00").
If you never want to process an existing file, you can close the file that you have opened, then open the same file as output and close the file. This will create a new, empty data file which you can then open i-o and you will be processing an empty data file.
#COBOL
#ServerExpress
#netexpress
#RMCOBOL
#AcuCobol



