In VSAM, the physical record is the control interval (CI). It is the actual unit of data that is read or written in one I/O operation between the program's buffers and DASD. The term "block" is often used for the same idea in other access methods (e.g. QSAM); in VSAM that block is the CI. The physical record (CI) contains many logical records—the data the application program works with—plus control information (RDFs, CIDF) and free space. Understanding the physical record helps you see why VSAM does not use BLKSIZE, how I/O works, and how the CI size (CISZ) affects how many logical records are moved in each read or write. This page explains what the physical record (block) is in VSAM, how it relates to the logical record, and how it differs from non-VSAM datasets.
The physical record is the fixed-size unit of storage that VSAM transfers in each read or write. In VSAM that unit is always the control interval. So when we say "physical record" or "block" in the VSAM context, we mean one CI. The CI size is set at define time with CISZ (e.g. 4096 or 8192 bytes) and is the same for every CI in the data component. There is no separate "block size" parameter; the block is the CI.
When your program issues a READ for one logical record, VSAM determines which CI contains that record (from the key, RBA, or RRN), reads that entire CI into a buffer if it is not already there, and then returns the requested logical record to your program. So the program never sees the physical record; it only sees logical records. But under the covers, every I/O is in whole CIs. That is why tuning CI size (CISZ) matters: it sets how much data is moved per I/O and how many logical records fit in that one transfer.
The physical record (CI) is the container; the logical record is the item. One physical record (one CI) holds many logical records (except when using spanned records, where one logical record can span multiple CIs). The relationship is:
So "block" and "physical record" are the same in VSAM: the CI. You do not specify "block size" separately from CI size; CISZ is the block size. The number of logical records per CI depends on CISZ, RECORDSIZE, FREESPACE (for KSDS/RRDS), and the overhead for RDFs and CIDF. For fixed 80-byte records in a 4096-byte CI you might get on the order of 50 records per CI (less if you reserve free space and after accounting for RDFs and CIDF).
For non-VSAM datasets (e.g. QSAM sequential files), you often specify LRECL (logical record length) and BLKSIZE (block size). The block is the unit of I/O; it can hold multiple logical records (blocking). In VSAM you do not specify BLKSIZE. You specify RECORDSIZE (logical record) and CISZ (control interval size). The CI is the block. So in JCL or in the program, BLOCK CONTAINS and BLKSIZE have no effect on VSAM; the access method ignores them. If you see BLKSIZE in a DD statement for a VSAM dataset, it is not used by VSAM for blocking. The blocking is entirely determined by DEFINE CLUSTER (CISZ and RECORDSIZE).
| Aspect | VSAM | QSAM (typical) |
|---|---|---|
| Physical unit | Control interval (CI); size set by CISZ | Block; size set by BLKSIZE (or system default) |
| Where specified | DEFINE CLUSTER (CISZ) | DCB BLKSIZE or JCL |
| Logical unit | Logical record (RECORDSIZE) | Record (LRECL) |
| Blocking | Internal; many logical records per CI | BLKSIZE/LRECL ratio = blocksize |
The size of the physical record (CI) affects performance. For sequential processing, a larger CI means more logical records per I/O, which can reduce the number of I/Os and improve throughput. For random access, a larger CI means each random read brings in more data than may be needed for one logical record, which can use more buffer space and memory bandwidth. So the choice of CISZ is a tradeoff. The default is often 4096 bytes; for heavily sequential workloads 8192 or 16384 might be better. The physical record size is fixed for the life of the cluster; you cannot change it with ALTER. To change it you must define a new cluster with the desired CISZ and copy the data (e.g. with REPRO).
The physical record (CI) contains: (1) logical records (or RRDS slot entries), packed from the start of the CI; (2) free space (for KSDS/RRDS), reserved for inserts; (3) record descriptor fields (RDFs), which describe each logical record's length; and (4) the control interval descriptor field (CIDF) at the end. So the "block" is not just raw record data; it includes VSAM's control information. That is why the number of logical records per CI is less than CISZ divided by logical record length—you must subtract the space used by RDFs, CIDF, and free space. For a more detailed breakdown, see the Control Interval (CI) page.
The index component of a KSDS also has physical records: index control intervals. Each index CI holds index entries (e.g. key + pointer to data CI). Index CIs are also read and written as units. The index CI size may be specified separately or defaulted; the same idea applies—the index "block" is the index CI.
The physical record is the whole drawer (control interval). When you ask for one card (logical record), the computer brings the whole drawer to the desk and then gives you just that one card. You only see the card; the computer always moves whole drawers. The size of the drawer (CI size) is set when the filing system is built and cannot be changed without building a new cabinet and moving all the drawers.
1. In VSAM, what is the physical record?
2. Do you use BLKSIZE for a VSAM dataset?
3. How does the program access data in a VSAM file?