VSAM LINEAR Parameter

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.

What LINEAR Means

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.

LINEAR vs INDEXED, NONINDEXED, NUMBERED

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.

Characteristics of an LDS

LINEAR (LDS) characteristics
AspectValue
Record structureNone; byte stream
KeyNone; do not specify KEYS
AddressabilityByte offset (e.g. page/sector)
ComponentsData only; no CI record layout
Typical usersDb2, VSAM RLS, system components
Application record I/ONot used; use KSDS/ESDS/RRDS

What You Do Not Specify with LINEAR

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.

Syntax and Example

Example DEFINE CLUSTER for an LDS (conceptual; exact syntax may vary by IDCAMS version):

jcl
1
2
3
4
5
6
DEFINE 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.

When LINEAR Is Used

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.

Key Takeaways

  • LINEAR creates a Linear Data Set (LDS): byte-addressable storage with no record structure. Do not specify KEYS or RECORDSIZE for record layout.
  • LDS is addressed by byte offset; the consumer (e.g. Db2, RLS) typically uses fixed-size units such as pages.
  • LDS is used by products and subsystems (Db2, VSAM RLS), not typically by application programs for normal record I/O.
  • For application files with records and keys, use INDEXED (KSDS) or NONINDEXED (ESDS); use LINEAR only when required by a product or design.
  • Organization type is fixed at define time; you cannot change LINEAR to INDEXED or another type with ALTER.

Explain Like I'm Five

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.

Test Your Knowledge

Test Your Knowledge

1. Which DEFINE CLUSTER keyword creates an LDS?

  • INDEXED
  • NONINDEXED
  • NUMBERED
  • LINEAR

2. Do you specify KEYS for a LINEAR cluster?

  • Yes, always
  • No, LDS has no key
  • Only for Db2
  • Only with RECORDSIZE

3. Who typically uses an LDS?

  • COBOL applications for master files
  • Db2 and VSAM RLS (system/subsystem components)
  • Batch sort programs
  • ISPF browse
Published
Updated
Read time5 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: IBM z/OS DFSMS documentationSources: IBM DFSMS Access Method Services, z/OS MVS DFSMS Defining VSAM Data SetsApplies to: z/OS 2.5