A Partitioned Data Set (PDS) is a collection of sequential members (files) consisting of one or more records. Each member is identified by a name 1 to 8 characters long. The member names are stored in a directory that is also part of the data set. The directory consists of one or more records at the beginning of the data set. Each member has an entry in the directory.
The directory entry is made up of the member name, a pointer to the starting location of the member data and up to 62 bytes of optional user data information. The directory is maintained in alphameric sorting sequence.
The pointer to the member data is a relative offset within the data set specified as TTR (Track, Record). The directory entries may be variable in length depending on the length of the optional data.
Directory blocks are keyed records with an eight-byte key. The key is the last member name contained in the directory block.
Each directory block begins with a two byte count indicating how many bytes are used in the directory block.
The member directory entry has the format:
- CL8 – Name (Member name)
- XL3 – TTR (Offset to beginning of member)
- X – “C” field
- Bit 0 – 1=Alias, 0=Not Alias
- Bits 1-2 – Number of pointers in the user data area
- Bits 3-7 – Binary number indicating the number of halfwords of user data.
User data length is always a multiple of two and may be 0-62 bytes long.
The end of the directory is indicated by an EOF mark (a record with a data length of zero) which will cause a Unit Exception when read. Each member is also ended with an EOF mark.
To access a member in a PDS the directory entry for the member is located. The TTR is then used to locate the first record of the member. The records for a PDS member are sequential.
Below are two directory blocks. The first block is full containing seven directory entries. The second only contains two entries plus an EOF directory entry with a name of x’FFFFFFFFFFFFFFFF’.
00001200 00FEE3E7 E7D5E4C3 F2F20003 092C0003 ..TXXNUC22...... 00001210 0E000000 000002E2 00035803 58000000 .......S........ 00001220 88000001 0000E3E7 E7D5E4C3 F2F30003 H.....TXXNUC23.. 00001230 112C0003 16000000 000002E2 00035803 ...........S.... 00001240 58000000 88000001 0000E3E7 E7D5E4C3 ....H.....TXXNUC 00001250 F2F40003 192C0003 1E000000 000002E2 24.............S 00001260 00035803 58000000 88000001 0000E3E7 ........H.....TX 00001270 E7D5E4C3 F2F50003 212C0003 26000000 XNUC25.......... 00001280 000002E2 00035803 58000000 88000001 ...S........H... 00001290 0000E3E7 E7D5E4C3 F2F60003 292C0003 ..TXXNUC26...... 000012A0 2E000000 000002E2 00035803 58000000 .......S........ 000012B0 88000001 0000E3E7 E7D5E4C3 F2F70003 H.....TXXNUC27.. 000012C0 312C0003 36000000 000002E2 00035803 ...........S.... 000012D0 58000000 88000001 0000E3E7 E7D5E4C3 ....H.....TXXNUC 000012E0 F2F80003 392C0004 05000000 000002E2 28.............S 000012F0 00035803 58000000 88000001 00000000 ........H.......
00001200 0056E3E7 E7D5E4C3 F2F90004 082C0004 ..TXXNUC29...... 00001210 0D000000 000002E2 00035803 58000000 .......S........ 00001220 88000001 0000E3E7 E7D5E4C3 F3F00004 H.....TXXNUC30.. 00001230 102C0004 15000000 000002E2 00035803 ...........S.... 00001240 58000000 88000001 0000FFFF FFFFFFFF ....H........... 00001250 FFFF0000 00000000 00000000 00000000 ................ 00001260 00000000 00000000 00000000 00000000 ................ ... 000012F0 00000000 00000000 00000000 00000000 ................