BSAM is Basic Sequential Access Method. This is an access method for storing or retrieving data blocks in a continuous sequence, using either a sequential access or a direct access device. BSAM is available on OS/360, OS/VS2, MVS, z/OS, and related high-end operating systems.
In BSAM, “basic”, refers to – in this specific context, unbuffered with no deblocking of reads and no blocking of writes, although buffering is an option, but neither deblocking nor blocking. It allows programs to read and write physical blocks of data, as opposed to the more advanced Queued Sequential Access Method (QSAM) which allows programs to access logical records within physical blocks of data.
As a BSAM user one must be aware of truncated final blocks (a block at the end of a dataset which is shorter than the BLKSIZE of the dataset) and, in many cases, embedded truncated blocks (blocks within a dataset which are shorter than the BLKSIZE of the dataset). So-called “standard blocks” (blocks being equal to the BLKSIZE) may, in some cases, be forced, but the user must still be prepared for at least the final block being truncated.
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.
BSAM arranges records sequentially in the order in which they are entered. A data set that has this organization is a sequential data set. The user organizes records with other records into blocks. This is basic access. You can use BSAM with the following data types:
- basic format sequential data sets (before z/OS 1.7 these were known as sequential data sets or more accurately as non-
- extended-format sequential data sets
- large format sequential data sets
- extended-format data sets
- z/OS UNIX files