LINEAR is the DEFINE CLUSTER keyword that creates a Linear Data Set (LDS). An LDS is not a record-oriented dataset: it has no primary key, no logical records in the VSAM sense, and no control interval record layout. Instead it is a contiguous extent of byte-addressable storage. You (or more often a product like Db2 or VSAM Record Level Sharing) read and write at byte offsets, typically in fixed-size units such as 4 KB pages. LINEAR is one of four organization types (with INDEXED, NONINDEXED, NUMBERED). Most application programs use INDEXED (KSDS) or NONINDEXED (ESDS) for record I/O; LINEAR is used by system and subsystem components that require raw storage. This page explains what LINEAR does, how LDS differs from KSDS/ESDS/RRDS, and when LINEAR is used.
When you specify LINEAR in DEFINE CLUSTER, IDCAMS creates an LDS. The cluster has a data component, but that component is not divided into logical records with keys or RDFs. It is a linear sequence of bytes. Space is allocated in cylinders or tracks; the size you specify is the raw capacity. There is no index component (no key to index). There is no RECORDSIZE in the sense of min/max record length—the dataset is a byte stream. Access is by byte offset: the application or product issues read/write requests for a range of bytes at a given offset. VSAM moves bytes between DASD and memory but does not interpret the content. So LINEAR is the only organization type that is truly "non-record": no keys, no record boundaries, just bytes.
INDEXED (KSDS) has records and a primary key; you specify KEYS and RECORDSIZE. NONINDEXED (ESDS) has records in entry order; you specify RECORDSIZE, no KEYS. NUMBERED (RRDS) has records or slots addressed by RRN; you specify RECORDSIZE, no KEYS. LINEAR (LDS) has no records: no KEYS, no RECORDSIZE in the record sense. You allocate space (e.g. CYLINDERS or TRACKS); the result is a byte stream. So LINEAR is the outlier: it is not for application-level record I/O but for low-level or product-level byte storage.
| Aspect | Value |
|---|---|
| Record structure | None; byte stream |
| Key | None; do not specify KEYS |
| Addressability | Byte offset (e.g. page/sector) |
| Components | Data only; no CI record layout |
| Typical users | Db2, VSAM RLS, system components |
| Application record I/O | Not used; use KSDS/ESDS/RRDS |
For LINEAR you do not specify KEYS—there is no key. You do not specify RECORDSIZE in the same way as for KSDS/ESDS/RRDS (no logical record layout). You do specify space allocation: CYLINDERS(primary secondary) or TRACKS(primary secondary) to define how much byte capacity the LDS has. You may specify VOLUMES and other allocation parameters. There is no INDEX component. FREESPACE is not applicable in the same way because there are no record-based inserts or splits. The DEFINE CLUSTER for an LDS is simpler in that record-related parameters are omitted.
Example DEFINE CLUSTER for an LDS (conceptual; exact syntax may vary by IDCAMS version):
123456DEFINE CLUSTER ( - NAME(USERID.DATA.LDS) - LINEAR - CYLINDERS(10 2) - VOLUMES(SYSDA)) - DATA (NAME(USERID.DATA.LDS.DATA))
LINEAR makes this an LDS. There is no KEYS, no RECORDSIZE. Space is in cylinders. The result is a byte-addressable extent. Typically such a cluster is created and used by a product (e.g. Db2) or by system procedures, not by a normal application program reading/writing records.
LINEAR (LDS) is used when: (1) A product or subsystem requires raw byte storage—e.g. Db2 for certain tablespace or storage configurations. (2) VSAM Record Level Sharing (RLS) uses LDS for shared cache and related structures. (3) Other z/OS components use LDS for data-in-virtual or similar byte-oriented storage. Application programmers defining their own VSAM files for master data, transaction files, or reports use INDEXED (KSDS) or NONINDEXED (ESDS) or NUMBERED (RRDS). They do not normally use LINEAR unless they are implementing a component that explicitly requires an LDS. If you are in doubt, use INDEXED or NONINDEXED for record-oriented data.
LINEAR is like one long tape or one big block of storage: there are no folders, no labels, no slots—just a stretch of bytes. The computer (or a program like Db2) remembers "my data is at byte 10000" and reads or writes from there. The other types (INDEXED, NONINDEXED, NUMBERED) are like filing systems with records or slots. So LINEAR is the "raw storage" option; the others are for "records with structure." Most programs use the record types; LINEAR is for special uses by the system or by products like Db2.
1. Which DEFINE CLUSTER keyword creates an LDS?
2. Do you specify KEYS for a LINEAR cluster?
3. Who typically uses an LDS?