Coding input-output statements for line-sequential files
Code the input and output statements shown below to process a line-sequential file.
OPEN
- To
initiate the processing of a file.
You can open a line-sequential file as
INPUT
,OUTPUT
, orEXTEND
. You cannot open a line-sequential file asI-O
. READ
- To read a record
from a file.
With sequential processing, a program reads one record after another in the same order in which the records were entered when the file was created.
WRITE
- To create a record
in a file.
A program writes new records to the end of the file.
CLOSE
- To release the connection between a file and the program.
related tasks
Defining line-sequential files and records in COBOL
Describing the structure of a line-sequential file
Opening line-sequential files
Reading records from line-sequential files
Adding records to line-sequential files
Closing line-sequential files
Handling errors in line-sequential files
Defining line-sequential files and records in COBOL
Describing the structure of a line-sequential file
Opening line-sequential files
Reading records from line-sequential files
Adding records to line-sequential files
Closing line-sequential files
Handling errors in line-sequential files
related references
OPEN statement (Enterprise COBOL for z/OS® Language Reference)
READ statement (Enterprise COBOL for z/OS Language Reference)
WRITE statement (Enterprise COBOL for z/OS Language Reference)
CLOSE statement (Enterprise COBOL for z/OS Language Reference)
OPEN statement (Enterprise COBOL for z/OS® Language Reference)
READ statement (Enterprise COBOL for z/OS Language Reference)
WRITE statement (Enterprise COBOL for z/OS Language Reference)
CLOSE statement (Enterprise COBOL for z/OS Language Reference)