From the point of view of DMS, a record is an indivisible data element. Both with regard to locating data in a file and to transferring data from and to the calling program.
This means that each data block must be at least as long as the longest record in the file. For disk files, the block format must be compatible with the block format of PPAM.
A data block is made up of one or more PAM pages. A tape file may consist of standard or nonstandard blocks. The maximum data block length for a disk or tape file is 32768 bytes.
Examples of record/block/PAM page relationships for SAM
File attributes:
RECORD-FORMAT=*FIXED
fixed-length records
RECORD-SIZE=100
record length 100 Byte
BUFFER-LENGTH=*STD(SIZE=2)
block length = 2 PAM pages = 2*2048 Byte = 4096 Byte
Each data block contains 40 records, and 96 bytes are left free in each block. Each data block consists of 2 PAM pages. DMS stores records within a data block without regard for the boundaries between PAM pages. In this example, the first 48 bytes of record 21 are in the first PAM page, and the remaining 52 bytes are in the second PAM page.
File attributes:
RECORD-FORMAT=*FIXED
fixed-length records
RECORD-SIZE=1500
record length 1500 Byte
BUFFER-LENGTH=*STD
block length = 1 PAM page
This is a very inefficient combination, because 548 bytes are “wasted” in each block. A better block length would be 6144 bytes (3 PAM pages, BUFFER-LENGTH= (*STD(SIZE=3)), since the data block would then contain 4 records and 6000 of the 6144 bytes would be used.
File attributes:
RECORD-FORMAT=*FIXED
fixed-length records
RECORD-SIZE=8192
record length 8192Byte
BUFFER-LENGTH=*STD(SIZE=8)
block length = 8 PAM pages
Each data block contains 2 records and each record occupies 4 PAM pages.