We can set the position of the file pointer using special instructions.
rewind(unit=10)positions the file pointer to the beginning of the specified unit. Note that, writing a record in a sequential file destroys all subsequent information, so by rewinding and writing a file we lose all the data.
backspace(unit=10, iostat=ierr)positions the file pointer back one record.
endfile(unit=10)inserts the endfile record in the file, and keeps the file open, with the file pointer positioned on the endfile record.