Jump to content

Basic direct access method

From Alfawiki
Basic Direct Access Method (BDAM)
Company typeAccess method
IndustryComputer software
Headquarters
United States
ProductsData retrieval and storage routines for IBM mainframe OSes
ParentIBM

Basic Direct Access Method (BDAM) is an access method designed for IBM's OS/360 and successors operating systems running on System/360 and subsequent mainframe platforms. BDAM consists of a set of routines enabling data retrieval and storage on direct access devices. This method is supported on systems including OS/360, OS/VS2, MVS, z/OS, and other advanced IBM mainframe environments.

Description

Within IBM terminology, the term basic denotes a low-level access method that manages data sets as physical blocks without utilizing features like read-ahead or synchronization. Consequently, programs must explicitly wait for I/O operations to complete before proceeding.

BDAM permits programmers to access or store a block by specifying its exact device address, a relative block number, or a relative track location within the data set. It does not inherently provide indexing or file structure; therefore, applications typically implement their own hashing or randomizing algorithms to determine block addresses based on data keys. When using physical keys, the key associated with the last record in each block functions as that block’s key.

The BDAM interface operates similarly to open, read, write, and close system calls familiar in other operating systems such as Unix and Windows.

IBM maintained BDAM compatibility up through 2012. Because BDAM depends on the physical layout of devices, newer IBM direct-access hardware used with z/OS emulates the characteristics of IBM 3390 devices regardless of their actual device design.

Application program interface

To employ BDAM, programmers indicate DSORG=DA within the Data Control Block (DCB). Space allocation can extend to 16 extents per volume, and datasets may span up to 255 extents distributed over multiple volumes. For applications that require contiguous storage space, the DD statement may include SPACE=(,,CONTIG).

Direct data sets must be initialized by opening them for output and sequentially writing every block, either with placeholder records or initial content.

As a basic access method, BDAM performs asynchronous block reads and writes of member data, necessitating the use of the CHECK macro to verify completion of I/O operations. It utilizes standard macros including OPEN, CLOSE, READ, WRITE, and CHECK. The READ or WRITE macros require specification of either a block address or record key. BDAM supports multiple simultaneous I/O processes.

Records may contain user-defined recorded keys up to 255 bytes in length; all keys within a dataset share identical length. Reads and writes can specify both a key and a disk address; in such cases, BDAM searches from the indicated block forward through the dataset for matching keys. This mechanism facilitates handling multiple keys that hash to the same track under management by the I/O subsystem.

Disk addresses

BDAM accepts disk addressing in three forms: device addresses, relative track addresses, or relative block numbers.

Device addresses consist of eight-byte fields formatted as MBBCCHHR, where each subfield is represented in binary:

  • M indicates the extent number for datasets spread across multiple extents (non-contiguous files).
  • BB is always zero; it formerly represented the bin number on an IBM 2321 Data Cell.
  • CC denotes the absolute cylinder number.
  • HH specifies the track (head) number.
  • R identifies the record number on the track; record zero contains control information and cannot be used for data.

Datasets addressed via device addresses cannot be relocated.

Relative track addresses are three-byte fields structured as TTR:

  • TT represents the relative track number within the dataset, starting at zero.
  • R is the record number on that track.

Relative block numbers are four-byte binary values indicating the block position within the file, beginning at zero. This addressing mode applies exclusively to fixed-length blocks (RECFM=F).

See also

References


External links