Data Set Organizations - IBM Mainframe

Within a data set, data can be organized in one of several ways depending on how the data will ultimately be processed. The variety of data set organizations that can be used under MVS fall into two categories— non-VSAM and VSAM.

Non-VSAM Data Set Organization

MVS, apart from VSAM, provides four basic ways of organizing data stored in data sets—physical sequential, indexed sequential, direct, and partitioned. When physical sequential organization is used, records are stored one after another in consecutive sequence. Sometimes, a data element within each record contains a key value that is used to sequence the records in the file in a particular order. A sequential file can reside on just about any type of I/O device that can be attached to an MVS system, including tape drives, card readers and punches, and printers. In fact, physical sequential is the only file organization that is allowed for those devices, because by nature they require data to be processed in a sequential manner, one record after the next.

Physical sequential organization is appropriate for a DASD file when the file's records do not have to be retrieved at random. When a DASD file is processed sequentially, access from one record to the next is fast. But a disadvantage of sequential files is that records have to be processed one at a time from the beginning, as if the file resided on tape.

In contrast, a file with indexed sequential organization is set up so that records can be accessed sequentially and randomly, depending on processing requirements. To do that, an indexed sequential file includes an index that relates key field values to the locations of their corresponding data records. Here, each entry in the index relates a key value to the location of a corresponding data record. Using this scheme, records can be retrieved sequentially or randomly. In a file with direct organization, each record can be accessed at random. However, a direct file does not use an index to enable random processing. Instead, you have to know a record's disk location to access it randomly. Direct files are not commonly used for user applications because of the programming complexities involved in calculating disk addresses.

A particularly interesting type of MVS file organization is partitioned organization. A partitioned data set (sometimes called a PDS or a library) is divided into one or more members, each of which can be processed as if it were a separate physical sequential file. To keep track of the members in a PDS, each member's name is stored in a directory. Although members of a PDS are usually processed individually, the entire library can be processed as a unit. Of the four non-VSAM file organizations, the most important are physical sequential and partitioned; indexed sequential and direct are not used as commonly because their functions are better handled by VSAM files. Physical sequential organization provides the basic support you need to process data on any type of device other than DASD. And partitioned data sets are widely used by MVS to store important operating system information, as well as by programmers to store libraries of programs in various stages of development.

VSAM Data Set Organization

VSAM arranges records by index key, relative record number, or relative byte address. It is used for direct or sequential processing of fixed-length and variable length records on DASD. VSAM data is cataloged for easy retrieval. VSAM supports five data set organizations:

  • Key-sequenced data set (KSDS)
  • Entry-sequenced data set (ESDS)
  • Relative record data set (RRDS), of which there are two types:
  • Fixed-length relative record data set (RRDS)
  • Variable-length relative record data set (VRRDS)
  • Linear data set (LDS)
  • HFS files

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

IBM Mainframe Topics