In IBM mainframeoperating systems, Basic sequential access method is an access method to read and write datasets sequentially. BSAM is available on OS/360, OS/VS2, MVS, z/OS, and related operating systems. BSAM is used for devices that are naturally sequential, such as punched card readers, punches, line printers, and magnetic tape. It is also used for data on devices that could also be addressed directly, such as magnetic disks. BSAM offers device independence: to the extent possible, the same API calls are used for different devices. BSAM allows programs to read and write physical blocks of data, as opposed to the more powerful but less flexible Queued Sequential Access Method which allows programs to access logical records within physical blocks of data. The BSAM user must be aware of the possibility of encountering short blocks, particularly at the end of a dataset, but also in many cases within a dataset. QSAM has none of these limitations.
The programmer specifies DSORG=PS in his Data Control Block to indicate use of BSAM. As a basic access method BSAM reads and writes member data in blocks and the I/O operation proceeds asynchronously and must be tested for completion using the CHECK macro. BSAM uses the standard system macros OPEN, CLOSE, READ, WRITE,and CHECK. The NOTEmacro instruction returns position of the last block read or written, and the POINT macro will reposition to the location identified by a previous NOTE. If the dataset is unblocked, that is, the logical record length is equal to the physical block size, BSAM may be utilized to simulate a directly accessed dataset using NOTE and POINT on any supported direct access device type, and some primitive applications were designed in this way.
Similar facilities
The BSAM application program interface can be compared with the interface offered by open, read, write and close calls in other operating systems such as Unix and Windows. POINT provides an analog of seek or lseek,and ftell is the equivalent of NOTE.