To read from a line-sequential file, open the file and use the READ statement. Your program reads one record after another in the same order in which the records were entered when the file was created.
Characters in the file record are read one at a time into the record area until one of the following conditions occurs:
The delimiter is discarded and the remainder of the record area is filled with spaces. (Record area is longer than the file record.)
If the next unread character is the record delimiter, it is discarded. The next READ reads from the first character of the next record. (Record area is the same length as the file record.)
Otherwise the next unread character is the first character to be read by the next READ. (Record area is shorter than the file record.)
The remainder of the record area is filled with spaces. (Record area is longer than the file record.)
related tasks
Opening line-sequential files
Adding records to line-sequential files
Closing line-sequential files
Defining and allocating line-sequential files
related references
OPEN statement (Enterprise COBOL Language Reference)
WRITE statement (Enterprise COBOL Language Reference)