Sequential dataset
The simplest dataset: records one after another, read from the start to the end.
Also written PS, physical sequential, flat file
Why it matters. Most batch files are sequential: extracts, payment files, reports. A job reads the whole file in one pass.
See it
Read a name
Tap a dataset to read its name, then open it.
PO. Partitioned: a drawer of folders, with members inside.
Zed's, in development, holding jobs. A library, so it has members.
Members
Tap a member to open it.
Syntax
ALLOCATE DATASET('name') NEW DSORG(PS) SPACE(p,s) TRACKS- DSORG(PS)
- Physical sequential.
- RECFM, LRECL
- Shape of the records.
- SPACE
- How much disk space to reserve.
- DISP=MOD
- Add new records after the last one.
Try it ALLOC
- 1
Make a sequential file called ZB0001.DEV.EXTRACT.
ALLOC DSN('ZB0001.DEV.EXTRACT') NEW DSORG(PS) SPACE(1,1) TRACKS - 2
Look at the details of the new file.
LISTDS 'ZB0001.DEV.EXTRACT'
Remember
- PS means records stored one after another.
- To reach record 100, a program reads the 99 before it.
- It has no members. A library (PO) does.
The usual mistake
Looking for a member in a sequential file: ZB0001.DEV.EXTRACT(A)
A sequential file is one list of records. It has no names inside it.
Use the plain file name, or make a library if you need members
On real z/OS
ALLOCATE here fills in FB and 80 when you leave them out, and the space figures are accepted but not modelled. Real z/OS takes them from your options, or from a data class on a storage-managed system, and a bad combination is refused by the system or fails when the file is opened.
Where can I practise Sequential dataset?
Right here, at ZedBank. You take a junior job at a simulated bank and use Sequential dataset in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- DatasetWhat a mainframe calls a file: a named collection of records with a defined structure, rather than a loose stream of bytes.
- Record formatWhether the records in a dataset are all the same length or vary, and how they are blocked. Written as RECFM.
- Logical record lengthHow long each record in a dataset is, in characters, written as LRECL.
- 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.