Sequential, partitioned, and the rest
z/OS has several dataset organisations, and you pick one based on how the data will be used. Three cover most of what you will meet: sequential for flat files, partitioned for libraries, and VSAM for indexed data.
Sequential (PS)
The workhorse of batch. Records one after another, read from the beginning. A daily transaction file, a report, an extract — all sequential. Cheap, fast, simple. If you do not need random access, this is the right answer.
Partitioned (PDS and PDSE)
A library: a directory plus a set of members. Your JCL library, your source library and your load library are all partitioned. The two flavours matter:
| PDS | PDSE | |
|---|---|---|
| Directory | Fixed size, set at allocation | Grows automatically |
| Deleted member space | Wasted until you compress | Reclaimed automatically |
| Directory full | Allocation fails; must be rebuilt | Does not happen |
| Concurrent update | One writer | Multiple members can be updated at once |
| Recommended for new work | No | Yes |
Record formats
| RECFM | Meaning | Typical use |
|---|---|---|
| FB | Fixed-length, blocked | Most batch files; every record the same length |
| VB | Variable-length, blocked | Records of differing length; first 4 bytes hold the length |
| FBA / VBA | …with ANSI carriage control | Printed reports |
| U | Undefined | Load modules |
LRECL is the record length; for VB it is the maximum, and it must include the 4-byte length prefix. BLKSIZE=0 lets the system choose an efficient block size, which is nearly always the right choice.
Space
SPACE=(CYL,(50,10),RLSE) | | | | | | | +- give back unused space at close | | +------ secondary: each extra extent | +---------- primary: allocated up front +----------------- unit: CYL, TRK, or a block size For a PDS you also need directory blocks: SPACE=(CYL,(10,5,20)) <- 20 directory blocks
Common mistakes
Use PDSE for anything new. The directory-full and compress problems are entirely avoidable.
BLKSIZE=0 lets the system pick the optimal value for the device. A hand-set value is usually worse and sometimes invalid.
There is a limit on the number of extents. A small secondary uses them up and produces an x37 abend long before the volume is full.
Omit them and the allocation fails or the library holds far fewer members than intended.
What you will see at work
- Compressing a PDS (option Z in 3.4, or the IEBCOPY utility) is a routine housekeeping task at sites that still have them.
- Your site's storage management will supply many of these values automatically through data classes — ask which parameters you are expected to code.
- When a job fails with Bx7, look at the SPACE on the DD before anything else.
Key terms
Check your understanding.
Take this lesson's quiz and save your progress. Free.