Sequential Access Method


 

Sequential access is the most simple method of processing records within a data file. Records within the data file are directly processed sequentially forward or backward. This technique does not require prior access to a key file before actual record positioning takes place.

Note the following:

  1. Information is processed one logical record at a time, in sequential order.

  2. Each logical record is terminated with an End Of Record (EOR) mark. The next record starts immediately after the EOR mark for the preceding record. The EOR is automatically written after each WRITE operation unless partial I/O is being performed.

  3. Records may span sector boundaries or more than one record may be placed within a sector's boundary, since processing is based upon End Of Record (EOR) terminator rather than the actual file position.

  4. Sequential records may be fixed or variable in length.

  5. Records written using the sequential method are not space compressed unless the *+ list control has been specified. The space compression technique utilized is the standard technique incorporated within the operating system so that the files are accessible by any program or utility compatible with the operating system in use.

  6. Sequential file processing using the -1 and -2 methods indicates standard sequential processing of the file in forward order. Sequential files may be processed using the -3 method (position to the End Of File prior to processing the record) for both READs and WRITES. In addition, there is a -4 method for reading a file sequentially backwards from the current file pointer position. The -4 method is only supported on sequential READ instructions (not WRITE).

  7. Under certain operating systems, logical devices (such as COM1: and LPT1: under MS-DOS or /dev/lp1 under Linux) may be opened as a logical FILE and processed using sequential -1 or -2 methods. The success of this method of access depends on two factors: The FILE must have been opened in a SHARE mode and the sector size for the file must be set to the lowest possible setting using BUFFER/FIX/FIXED.

 

 

See Also: Random Access Method, Indexed Sequential Access Method, Associative Access Method, Disk I/O Instructions

 



PL/B Language Reference File Access Methods Random Access Method