Temporary dataset
A dataset that exists only while one job runs and is deleted automatically when the job ends.
Also written &&TEMP, temp dataset, passed dataset, DSN=&&
A temporary dataset lives only for the length of one job. It is a place to keep data that one step produces and a later step reads, without creating a permanent dataset that someone has to clean up.
In JCL, a temporary dataset has a name that starts with two ampersands, such as DSN=&&SORTOUT, or no name at all. The system gives it a long, unique name of its own. A step creates it with DISP=(NEW,PASS), which keeps it available to later steps. Later steps refer to it by the same && name, often with DISP=(OLD,DELETE) in the last step that needs it.
When the job ends, the system deletes any temporary datasets that are left, whatever their disposition says.
A typical use is a sort step that writes sorted records to a temporary dataset, followed by a report step that reads them. Temporary datasets are not catalogued and other jobs cannot see them. If you need to look at the data after the job ends, write it to a permanent dataset instead.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- DispositionThe DISP parameter, which says whether a dataset already exists, and what to do with it when the step ends normally or fails.
- DD statementThe JCL statement that connects a name inside a program to a real dataset outside it.
- Job stepOne program execution within a job. A job is simply a sequence of steps that run in order.
- DFSORTThe standard sort utility, used far beyond sorting to select, merge, reformat and summarise records at speed.
- DatasetWhat a mainframe calls a file: a named collection of records with a defined structure, rather than a loose stream of bytes.
- JCLJob Control Language: the language used to tell the mainframe what programs to run, in what order, and with what files.