PPT Slide
Let’s consider an existing file has been connected to unit 7 for sequential access. A rewind initial position property for the connection was specified in the open statement. Suppose that several read statements are then executed.
1) If the file is unformatted, each read will advance the file by one record.
2) If the file formatted, each advancing read statement will advance the file by one record.
3) Each non advancing read from a formatted file will advance the file when a slash is encountered in the format or when rescan occurs, and the position remains within the current record at the end of execution of the statement.
Let us suppose that the end-of-file indicator is encountered. The file is then positioned following the end-of-file indicator, and indication of the end-of-file condition is returned to the program.