The OPEN statement creates an access stream to the file, makes the file available to the program, begins the processing of a file, and specifies file sharing.
1 – 1format_sequential_relative_indexed
The OPEN statement creates an access stream to the file, makes the file
available to the program, begins the processing of a file, and
specifies file sharing.
Format 1 - Sequential, Relative, Indexed
{ { [WITH LOCK ]} }
{ { [ {NO OTHERS }]} }
{ { [ {{|READERS |}}]} }
{{INPUT }{file-name[WITH NO REWIND][ALLOWING {{|WRITERS |}}]}...}
{{OUTPUT}{ [ {{|UPDATERS|}}]} }
{ { [ {ALL }]} }
OPEN{ }...
{ { [WITH LOCK ]} }
{ { [ { NO OTHERS } ]} }
{ { [ { {| READERS |}} ]} }
{{EXTEND}{ file-name [ALLOWING { {| WRITERS |}} ]}... }
{{I-O }{ [ { {| UPDATERS |}} ]} }
{ { [ { ALL } ]} }
1.1 – file-name
is the name of a file described in the Data Division. It cannot be the name of a sort or merge file.
2 – 2format_report_writer
The OPEN statement creates an access stream to the file, makes the file
available to the program, begins the processing of a file, and
specifies file sharing.
Format 2 - Report Writer
OPEN { OUTPUT { file-name [ WITH NO REWIND ] } ... } ...
{ EXTEND { file-name } ... }
2.1 – file-name
is the name of a file described in the Data Division. It cannot be the name of a sort or merge file.