In IBM mainframeoperating systems, basic partitioned access method is an access method for libraries, called partitioned datasets in IBM terminology. BPAM is used in OS/360, OS/VS2, MVS, z/OS, and others. A PDS consists of members, registered in a list called the directory. The combination of members and directory is a single dataset on disk. The directory contains a list of member's names and member's addresses. Addresses are relative to the start of the dataset in order to allow the PDS to be moved to a different disk location. Partitioned datasets can store any type of data, but they are often used to store executable programs, or load modules, sometimes called binaries in other systems. Other uses include system assembler macro definitions, job control procedures, and program source code.
BPAM provides an application program interface to allow programmers to access libraries directly. The BPAM API is similar to basic sequential access method, but it adds functionality to process directories. Individual members of a PDS can also be processed using sequential accessmethods by specifying the member name on the job control DD statement. The programmer specifies DSORG=PO in their Data Control Block to indicate use of BPAM. As a basic access method BPAM reads and writes member data in blocks and the I/O operation proceeds asynchronously and must be tested for completion using the CHECK macro. BPAM uses the standard system macros OPEN, CLOSE, READ, WRITE,and CHECK. The NOTEmacro instruction returns position of the last block read or written, and the POINT macro will reposition to the location identified by a previous NOTE. The BLDL macro can be used to build a list of the addresses of members specified by the programmer for later use, if desired. FIND positions to a single member, specified by name, which requires a directory lookup on disk, or by address previously retrieved by BLDL. The STOW macro is used to update the directory when a member is added, deleted, changed, or replaced.
Load modules
The operating system requires all executable programs to be stored in libraries because the member's directory entry contains additional attribute information specific to load modules. When used for storing load modules, directories also contain, among other data, the size of the load module and the address of the first "text record", which is different from the address of the first member data. Executable programs are written to libraries by the linkage editor and loaded into user-acquired storage by the Loader or into system-acquired storage by Program Fetch. The Linkage Editor organizes a load module in a specialized format consisting of alternating "text records" and "control/relocation dictionary records". This organization allows a load module to be completely loaded and relocated with one input/output operation by Program Fetch.