Summary -

In this topic, we have explained Access Methods in detail.

Access methods are software units that control the data transfer between main memory (primary storage) and secondary storage devices. Secondary or auxiliary storage devices are independent of computer memory— for example - tape or disk.

Access method creates some techniques to store and retrieve the data from the dataset. An access method is used to simplify the application logic when the application requests I/O operations to z/OS. An access method is an optional function. Application with EXCEP mode doesn't require an access method to run its I/O operations.

Access method has their system-provided programs to define dataset, dataset structures to organize data, and utility programs to process datasets. Access methods are recognized based on dataset organization.

Access Method Types -

Frequently using access methods are specified below -

BSAM -

BSAM is the short form of the Basic Sequential Access Method and is used in exceptional cases. BSAM allows the programs to read and write physical blocks of data. BSAM is an access method used for storing or retrieving data blocks in a continuous sequence using sequential (Example - tapes) or direct access devices(Example - disks).

BSAM arranges records sequentially in the order of how they are entered.

The user is responsible for organizing the records with other records into blocks.

BSAM is available on OS/360, OS/VS2, MVS, z/OS, and related high-end operating systems.

BSAM uses for the following dataset types -

  • basic format sequential data sets (flat files before z/OS 1.7)
  • large format sequential data sets (flat files)
  • extended-format data sets
  • z/OS UNIX files

DSORG=PS in Data Control Block (DCB) specifies the declared dataset uses BSAM. For example - Refer to the bold parameter in the below JCL.

//MTHUSRD  JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),        
//             NOTIFY=&SYSUID                                           
//**********************************************************************
//* ALLOCATE PS DATA SET USING IEFBR14 UTILITY                          
//**********************************************************************
//STEP10   EXEC PGM=IEFBR14                         
//SYSPRINT DD SYSOUT=*                                
//SYSOUT   DD SYSOUT=*                              
//SYSDUMP  DD SYSOUT=*                                 
//DD1      DD DSN=MTHUSR.TEST.BSAMFILE,                   
//            DISP=(NEW,CATLG,DELETE),VOLUME=SER=DEVHD2,    
//            SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,          
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
//*  

BSAM is replaced with QSAM after z/OS 1.7.

QSAM -

QSAM is the short form of Queued Sequential Access Method and the most used access method. QSAM is the extended method of Basic Sequential Access Method (BSAM). When QSAM is used, a queue is formed with -

  • a set of input blocks waiting for processing.
  • a set of output blocks that are processed and waiting transfer to secondary storage devices.

QSAM allows to access the logical records within the physical blocks of data.

QSAM reads the records into storage before they are actually requested to improve the performance. This technique is called as queued access.

QSAM organizes the records sequentially in the order of how they are entered to form sequential data sets. The system is responsible for organizing the records with other records.

QSAM used for the follwing datasets -

  • sequential data sets/flat files
  • extended-format data sets
  • z/OS UNIX files

Defining QSAM files and records in COBOL -

We can use FILE-CONTROL entry like below to define file as QSAM file in COBOL program -

FILE-CONTROL.
    SELECT file-name ASSIGN TO disk-name.
    ORGANIZATION IS SEQUENTIAL
    ACCESS MODE IS SEQUENTIAL.

DSORG=PS in Data Control Block (DCB) specifies the declared dataset uses QSAM if the z/OS version is > 1.7. For example - Refer to the bold parameter in the below JCL.

//MTHUSRD  JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),        
//             NOTIFY=&SYSUID                                           
//**********************************************************************
//* ALLOCATE PS DATA SET USING IEFBR14 UTILITY                          
//**********************************************************************
//STEP10   EXEC PGM=IEFBR14                         
//SYSPRINT DD SYSOUT=*                                
//SYSOUT   DD SYSOUT=*                              
//SYSDUMP  DD SYSOUT=*                                 
//DD1      DD DSN=MTHUSR.TEST.QSAMFILE,                   
//            DISP=(NEW,CATLG,DELETE),VOLUME=SER=DEVHD2,    
//            SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,          
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
//*  

BDAM -

BDAM is the short form of the Basic Direct Access Method and is becoming obsolete nowadays. It organizes records in any sequence based on the program specification and retrieves records by actual or relative address.

If we do not know the exact location of a record, we have to specify the starting point in the data set to begin the search. Data sets organized like this are called direct data sets.

BDAM is no longer supported by COBOL. However, the BDAM function(most part) has been replaced by RRDS VSAM files.

CICS supports access to keyed and non-keyed BDAM data sets. BDAM is used to create and format those datasets.

DSORG=DA in Data Control Block (DCB) specifies the declared dataset uses BDAM. For example - Refer to the bold parameter in the below JCL.

//MTHUSRD  JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),        
//             NOTIFY=&SYSUID                                           
//**********************************************************************
//* ALLOCATE PS DATA SET USING IEFBR14 UTILITY                          
//**********************************************************************
//STEP10   EXEC PGM=IEFBR14                         
//SYSPRINT DD SYSOUT=*                                
//SYSOUT   DD SYSOUT=*                              
//SYSDUMP  DD SYSOUT=*                                 
//DD1      DD DSN=MTHUSR.TEST.PSFILE,                   
//            DISP=(NEW,CATLG,DELETE),VOLUME=SER=DEVHD2,    
//            SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,          
//            DCB=(DSORG=DA,RECFM=FB,LRECL=80,BLKSIZE=800)
//*  

BPAM -

BPAM is the short form of the Basic Partitioned Access Method. BPAM organizes the records as members of a partitioned data set (PDS) or a partitioned data set extended (PDSE) on DASD.

BPAM is an access method for libraries with partitioned datasets (PDSes) structure. BPAM is used in OS/360, OS/VS2, MVS, z/OS, and others. A PDS is like a directory is a single dataset on disk that consists of members like PS(flat files).

DSORG=PO in Data Control Block (DCB) specifies the declared PDS uses BPAM. For example - Refer to the bold parameter in the below JCL.

//MTHUSRD  JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),        
//             NOTIFY=&SYSUID                                           
//**********************************************************************
//* ALLOCATE PS DATA SET USING IEFBR14 UTILITY                          
//**********************************************************************
//STEP10   EXEC PGM=IEFBR14                         
//SYSPRINT DD SYSOUT=*                                
//SYSOUT   DD SYSOUT=*                              
//SYSDUMP  DD SYSOUT=*                                 
//DD1      DD DSN=MTHUSR.TEST.PDS,                   
//            DISP=(NEW,CATLG,DELETE),VOLUME=SER=DEVHD2,    
//            SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,          
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)
//*  

VSAM -

VSAM is the short form of Virtual Storage Access Method. VSAM is an IBM invented access method that allows us to access and organize records in the disk data set. VSAM is available under the z/OS and one of the several access methods using in z/OS. VSAM works with the data that stores only on direct access storage devices (DASDs).

The term VASM applies to data set type and access methods that are used to manage various dataset types. VSAM access method provides much more complex functions than any other disk access method. VSAM record storage format is unique and not understandable by other access methods.

IDCAMS utility used to define the VSAM datasets. We will discuss VSAM more detail in further chapters.

VSAM has the below primary access method functions -

  • Blocking (by storing several logical records in one physical block).
  • Managing the buffer pool efficiently.
  • Starting the I/O driver through an SVC (SuperVisor Call).
  • Synchronizing tasks through the Wait function when the other job is running with the I/O operation.
  • Writing virtual channel programs for accessing records that are organized on 3390 tracks.
  • Start I/O error recovery.

There are dedicated access methods allotted for the specific datasets. For example - BSAM or QSAM used on sequential data sets.

There are some cases when an access method identified for one ogranization uses for different organization. For example - a sequential data set created by BSAM can be processed by BDAM.