LIKE parameter
A DD statement parameter that creates a new dataset with the same attributes as an existing one.
Also written LIKE=, model dataset, allocate like
LIKE lets you create a dataset that copies the attributes of another one. LIKE=ZBANK.PROD.MASTER on a DD statement for a new dataset takes its record format, record length, dataset organisation and space from the named dataset, so you do not have to code them.
It saves typing and avoids mistakes, especially when the new dataset must match an existing one exactly, such as a test copy of a production file. Any attribute you code yourself on the same DD statement overrides the copied one.
LIKE needs SMS to be active on the system. It does not copy everything. For example, it does not copy the data, the security profile, or every special attribute.
ISPF offers the same idea when you allocate a dataset in option 3.2: give the name of an existing dataset as a model, and its attributes fill the panel. In JCL, LIKE and referbacks to an earlier DD in the same job are the two common ways of not repeating attributes.
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
- DD statementThe JCL statement that connects a name inside a program to a real dataset outside it.
- DCB parameterA DD statement parameter that gives the attributes of a dataset, such as record format, record length and block size.
- SMSThe Storage Management Subsystem: the z/OS feature that decides where new datasets go and how they are backed up, kept and deleted, using rules the site writes.
- Space allocationReserving disk space for a dataset up front, in tracks, cylinders or blocks, with room to grow.
- DatasetWhat a mainframe calls a file: a named collection of records with a defined structure, rather than a loose stream of bytes.