Sequential file access

One of the most frequent operations used on files is to search for a particular record.

Sequential access of records occurs when a number of records, stored in key order, need to be successively read.

 

 

Sequential search of a file : To find a record in a file using a sequential search.

Open file;
Repeat
  Input a record from file
Until required record is found;
Output record data

 

 

Sequential processing of all records in a file.

Open file;
Repeat
  Input a record from file;
  Process the record;
Until end of file;