Jump to content

Basic sequential access method

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 24.194.254.65 (talk) at 20:37, 20 August 2016 (needs lots more work...). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In IBM mainframe operating systems, Basic sequential access method (BSAM)[1] is an access method to read and write datasets sequentially. BSAM is available on OS/360, OS/VS2, MVS, z/OS, and related high-end operating systems.

BSAM is used for devices that are naturally sequential, such as punched card readers, punches, line printers, and magnetic tape. It was 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 (QSAM) which allows programs to access logical records within physical blocks of data. As a basic access method BSAM provides no blocking/deblocking of data. Input/Output is asynchronous and must be tested for completion using the CHECK macro.

The BSAM user must be aware of the possibility of encountering short (truncated) blocks (blocks within a dataset which are shorter than the BLKSIZE of the dataset), particularly at the end of a dataset, but also in many cases within a dataset. QSAM has none of these limitations.

If the dataset is unblocked, that is, LRECL is equal to BLKSIZE, BSAM may be utilized to simulate a directly accessed dataset using NOTE (to notify the application of a record's position within the dataset) and POINT (to position the dataset for accessing the record specified by the application, using a value previously supplied by NOTE), on any supported direct access device type (DEVD=DA), and some primitive applications were designed in this way.

The BSAM application program interface can be compared with the interface offered by open, read, write and close calls (using file handles) in other operating systems such as Unix and Windows.

See also

References

  1. ^ IBM System/360 Operating System Sequential Access Methods Program Logic Manual (PDF). IBM. January 1967. Y28-6604-1.