Dataset
What a mainframe calls a file: a named collection of records with a defined structure, rather than a loose stream of bytes.
Also written file, data set
A dataset is the mainframe equivalent of a file, and the difference in name reflects a real difference in design.
On most systems a file is a stream of bytes, and any structure inside it is the application's business. A dataset is a collection of records, and the system knows about that structure. When you create one you declare how long each record is, whether records are fixed or variable in length, and how much space to set aside. The system enforces it from then on.
That sounds like extra bureaucracy, and at first it is. The payoff is that utilities, sort programs and languages like COBOL all understand the layout without being told again, and the system can manage storage efficiently because it knows what is coming.
Datasets come in several shapes. Sequential ones hold records one after another. Partitioned ones act as a library of separately named members. VSAM datasets support keyed access for records retrieved by identifier rather than position.
Alongside all of these, z/OS also supports ordinary Unix files through Unix System Services.
Related terms
- Dataset nameThe full name of a dataset, written as dot-separated qualifiers of up to eight characters each.
- Sequential datasetThe simplest kind of dataset: records stored one after another and normally read from start to finish.
- Partitioned datasetA dataset that works like a library or folder, holding many separately named members inside one dataset.
- VSAMA family of dataset types built for fast record access by key, used where applications need to look records up rather than read them in order.
- Record formatWhether the records in a dataset are all the same length or vary, and how they are blocked. Written as RECFM.
- CatalogThe system's index of where datasets live, so you can refer to a dataset by name without knowing which disk it is on.
- Generation data groupA set of datasets holding successive versions of the same file, so today's copy, yesterday's and last week's all exist under one name.