Basic sequential access method

Short description: Access method to read and write datasets sequentially

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 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 (QSAM) which allows programs to access logical records within physical blocks of data. 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.

## Contents

* 1 Application program interface
* 2 Similar facilities
* 3 See also
* 4 References

## Application program interface

The programmer specifies `DSORG=PS` in his Data Control Block (DCB) 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.[2] BSAM uses the standard system macros `OPEN`, `CLOSE`, `READ`, `WRITE`,and `CHECK`. The `NOTE` macro instruction returns position of the last block read or written, and the `POINT` macro will reposition to the location identified by a previous `NOTE`.[2]

If the dataset is unblocked, that is, the logical record length (LRECL) is equal to the physical block size (BLKSIZE), BSAM may be utilized to simulate a directly accessed dataset using `NOTE` and `POINT` on any supported direct access device type (DEVD=DA), 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 (using file handles) in other operating systems such as Unix and Windows. `POINT` provides an analog of seek or lseek,and ftell is the equivalent of `NOTE`.

## See also

* Queued Sequential Access Method (QSAM)
* Hierarchical Sequential Access Method (HSAM)
* Basic Indexed Sequential Access Method (BISAM)
* Queued Indexed Sequential Access Method (QISAM)
* Hierarchical Indexed Sequential Access Method (HISAM)

## References

1. ↑ IBM System/360 Operating System Sequential Access Methods Program Logic Manual. IBM. January 1967. Y28-6604-1. http://www.bitsavers.org/pdf/ibm/360/os/plm_1966-67/Y28-6604-1_Sequential_Access_Methods_PLM_Jan67.pdf.
2. ↑ 2.0 2.1 IBM Corporation (June 1973). OS Data Management Macro Instructions. http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/360/os/R21.7_Apr73/GC26-3794-1_OS_Data_Management_Macro_Instructions_Rel_21.7_Jun73.pdf. Retrieved August 19, 2016.

* v
* t
* e

OS/360 and successors I/O access methods

Low-level|

* EXCP
* EXCPVR
* STARTIO

Storage|

* XDAP
* BDAM
* BSAM
* QSAM
* BPAM
* ISAM
* VSAM
* OAM

Network|

* BTAM
* QTAM
* TCAM
* VTAM

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Basic sequential access method. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Basic_sequential_access_method&oldid=688440"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template