The data management routines of the operating system can handle a number of types of data sets, which differ in the way data is stored within them and in the allowed means of access to the data. The three main types of non-VSAM data sets and the corresponding keywords describing their PL/I organization1 are as follows:
| Type of data set | PL/I organization |
|---|---|
| Sequential | CONSECUTIVE or ORGANIZATION(consecutive) |
| Indexed | INDEXED or ORGANIZATION(indexed) |
| Direct | REGIONAL or ORGANIZATION(relative) |
A fourth type, partitioned, has no corresponding PL/I organization.
PL/I also provides support for three types of VSAM data organization: ESDS, KSDS, and RRDS. For more information about VSAM data sets, see Defining and using VSAM data sets.
In a sequential (or CONSECUTIVE) data set, records are placed in physical sequence. Given one record, the location of the next record is determined by its physical position in the data set. Sequential organization can be selected for direct access devices.
An indexed sequential (or INDEXED) data set must reside on a direct access volume. An index or set of indexes maintained by the operating system gives the location of certain principal records. This allows direct retrieval, replacement, addition, and deletion of records, as well as sequential processing.
A direct (or REGIONAL) data set must reside on a direct access volume. The data set is divided into regions, each of which contains one or more records. A key that specifies the region number allows direct access to any record; sequential processing is also possible.
In a partitioned data set, independent groups of sequentially organized data, each called a member, reside in a direct access data set. The data set includes a directory that lists the location of each member. Partitioned data sets are often called libraries. The compiler includes no special facilities for creating and accessing partitioned data sets. Each member can be processed as a CONSECUTIVE data set by a PL/I program. The use of partitioned data sets as libraries is described under Using libraries.