In IBM mainframe operating systems, Queued Sequential Access Method (QSAM)[1] is an access method to read and write datasets sequentially.
QSAM is used both for devices that are naturally sequential, such as punched card readers and punches and line printers, and for data on devices that could also be addressed directly, such as magnetic disks.
QSAM is—as its name says—queued, in this specific context meaning buffered with deblocking of reads and blocking of writes.
It allows programs to read and write logical records within physical blocks of data, as opposed to the less advanced basic sequential access method (BSAM) which allows programs to access physical blocks of data, but provides no support for accessing logical records within blocks.
The QSAM 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.