PPT Slide
Now let’s consider a file that has to be used for sequential output. It is connected to unit 13 and contains no records, no indication of the end-of-file condition. A rewind initial position property for the connection was specified in the open statement. Suppose that several write statements are then executed.
1) If the file is unformatted, each write will add one record to the file.
2) If the file formatted, each advancing write will add at least one record.
3) A non advancing write will add a new record when a slash is encountered in the format or when rescan occurs, but will not end the record after data transfer.
After the desired data has been transmitted to the file, the statement end file may be executed to append an end-of-file indicator following the last record written.