You can read VSAM file access modes in COBOL module quickly.
Access Modes to handle VSAM files in COBOL modules
Sequential read – Only sequentially you can read. First you need to give START command to establish a key. Then READ NEXT to get next record and so on.
START file-name KEY IS EQUAL TO ALTERNATE-RECORD-KEY
Random read – You can go to any key either forward way or backward way.
Dynamic read – You can read a record Sequentially and also you can read random record. When a direct READ is performed for a VSAM indexed file, based on an alternate index for which duplicates exist, only the first record in the data set (base cluster) with that alternate key value is retrieved.
You need a series of READ NEXT statements to retrieve each of the data set records with the same alternate key.
A file status code of 02 is returned if there are more records with the same alternate key value to be read; a code of 00 is returned when the last record with that key value has been read.
- The merits of VSAM alternate index
- The VSAM real story of merits and demerits
- VSAM access modes for files awesome details
- 5 Stunning Benefits of VSAM KSDS
- 5 Tricky Questions on VSAM alternate Index