ASSIGN TO “A:\PAYROLL.DAT”
DATA RECORD IS INDEXED-REC.
This file is an indexed VSAM file. That means that the records are stored on a disk using a methodology that includes indexes. This means that there will be two files: one containing the data and one containing the indexes. The index can be either numeric or alphanumeric. The index must be unique so frequently a field like social security number or some other identification number is used as the index.
In this example, the file is organized so that it has indexes. The field that is the index is specified in the record key clause. The access on this select is sequential which means that the file will be read sequentially one record at a time. Note that the indexed field that is the record key must then be defined in the FILE-SECTION.