Access Methods (for Beginners)


Summary

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 simplifies the application logic when the application requests I/O operations to z/OS.

Access Method Types -


Frequently using access methods are specified below -

BSAM -


  • BSAM is the short form of the Basic Sequential Access Method used in exceptional cases.
  • BSAM is an access method used for storing or retrieving data blocks in a sequence from sequential (Example - tapes) or direct access devices(Example - disks).
  • BSAM arranges records sequentially in the order of how they are entered.

BSAM uses for Flat files before z/OS 1.7, Flat files, Extended-format datasets and z/OS UNIX files.

DSORG=PS in DCB (Data Control Block) specifies the declared dataset using BSAM. For example - Refer to the DSORG 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)
//*  
Note! 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. It is extended method of the Basic Sequential Access Method (BSAM).
  • QSAM organizes the records sequentially in the order of how they are inserted to form sequential datasets. The system is responsible for managing the records, among other records.

QSAM was used for Sequential datasets / flat files, Extended-format datasets and z/OS UNIX files.

Defining QSAM files and records in COBOL -

We can use the FILE-CONTROL entry below to define the file that uses QSAM in COBOL program -

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

DSORG=PS in DCB (Data Control Block) specifies the declared dataset uses QSAM (if the z/OS version is > 1.7). For example - Refer to the DSORG 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.
  • If we do not know the exact location of a record, we have to specify the starting point in the dataset to begin the search. Datasets organized like this are called direct datasets.
  • COBOL no longer supports BDAM. However, the BDAM function (most part) has been replaced by RRDS VSAM files.
  • CICS supports access to keyed and non-keyed BDAM datasets.

DSORG=DA in DCB (Data Control Block) specifies the declared dataset uses BDAM. For example - Refer to the DSORG 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 dataset (PDS) or a partitioned dataset extended (PDSE) on DASD.

DSORG=PO in DCB (Data Control Block) specifies the declared PDS uses BPAM. For example - Refer to the DSORG 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 the Virtual Storage Access Method.
  • VSAM is an IBM-invented access method that allows us to access and organize the records in the disk dataset.
  • VSAM works with the data that stores only on Direct Access Storage Devices (DASDs).
  • The term VASM applies to dataset type and access methods used to manage various dataset types.
  • VSAM access method provides much more complex functions than any other disk access method.

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


There are dedicated access methods assigned for the specific dataset types. For example - BSAM or QSAM is used for sequential datasets.

There are cases where an access method is identified for one dataset type used for a dataset type. For example - a sequential dataset created by BSAM can be processed by BDAM.