LISTCAT
Lists what the catalog knows about your datasets.
Also written LISTC
Why it matters. It's the quickest way to see which datasets exist and check a name before you use it.
Syntax
{LISTCAT | LISTC} [LEVEL(level) | ENTRIES(entry-name)] [entry-type ...] [ALL | NAME | HISTORY | VOLUME | ALLOCATION]
LISTCAT [CATALOG(catalog-name)] [OUTFILE(ddname)]- LEVEL(level)
- List every entry whose name starts with this level. LVL is the short form.
- ENTRIES(name)
- List one entry by name. One * can stand for one qualifier. Quote the name.
- CATALOG(name)
- Look in this catalog only.
- NONVSAM
- List only ordinary (non-VSAM) datasets. NVSAM is the short form.
- CLUSTER
- List only VSAM clusters.
- ALL
- Show every field for each entry, such as volume, dates and space.
- VOLUME
- Add the volume serial and device type to each entry.
- OUTFILE(ddname)
- Send the listing to a file instead of the screen.
Try it LISTCAT
- 1
List every dataset whose name starts with ZBANK.
LISTCAT LEVEL(ZBANK) - 2
Ask for just the customer dataset, ZBANK.DATA.CUSTOMER.
LISTCAT ENTRIES('ZBANK.DATA.CUSTOMER') - 3
Try a name that doesn't exist: ZBANK.NO.FILE.
LISTCAT ENTRIES('ZBANK.NO.FILE')
Remember
- LEVEL lists everything that starts with a name.
- ENTRIES asks about one dataset. Use quotes.
- NOT FOUND means the catalog has no such name.
The usual mistake
LISTCAT
With no operand it lists only names under your own prefix, so the ZBANK datasets don't show.
LISTCAT LEVEL(ZBANK)
On real z/OS
MF/OS models LEVEL, ENTRIES and the name listing only. ALL, VOLUME, CATALOG and the entry-type operands are accepted but do not change the output, and the catalog name in IN-CAT is made up for the bank.
Where can I practise LISTCAT?
Right here, at ZedBank. You take a junior job at a simulated bank and use LISTCAT in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- CatalogThe system's index of where datasets live, so you can refer to a dataset by name without knowing which disk it is on.
- DatasetWhat a mainframe calls a file: a named collection of records with a defined structure, rather than a loose stream of bytes.
- High-level qualifierThe first part of a dataset name, which usually identifies the owner and drives how security and storage rules apply.
- TSOTime Sharing Option: the interactive login environment on z/OS, where you get a command prompt and a session of your own.