Catalogs: how a name becomes a location
You refer to a dataset by name, and the system finds it without you saying which disk it is on. That indirection is the catalog. Understanding it explains a whole family of otherwise baffling errors.
The two-level structure
- There is one master catalog per system. It is small and holds system datasets plus aliases.
- An alias maps a high-level qualifier to a user catalog.
PROD→ user catalog A;TEST→ user catalog B. - User catalogs hold the actual entries: dataset name, volume, and organisation.
- So the HLQ decides which catalog holds your dataset. This is why the HLQ matters so much.
The errors this explains
| Symptom | What it usually means |
|---|---|
| Dataset not found, but you can see it in 3.4 | You are looking at an uncatalogued dataset found by volume, not by catalog |
| NOT IN CATALOG on a job that ran yesterday | A previous step deleted it, or a rerun's delete step removed it |
| Duplicate dataset name on allocation | A catalog entry exists for a dataset that was deleted without being uncatalogued |
| A new HLQ cannot be allocated | No alias exists for it, so the system does not know which user catalog to use |
IDCAMS: the tool for all of this
//STEP010 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * LISTCAT ENT('PROD.PAY.MASTER') ALL LISTCAT LVL('PROD.PAY') DELETE 'PROD.PAY.OLD' DELETE 'PROD.PAY.GHOST' NOSCRATCH <- catalog entry only DEFINE NONVSAM(NAME('PROD.PAY.RECOV') - DEVT(3390) VOL(DASD01)) <- recatalog SET MAXCC=0 /*
Generation data groups
A GDG is a catalog construct: one name that stands for a series of generations. You refer to them relatively, which is what makes daily jobs rerunnable without editing JCL.
| Reference | Means |
|---|---|
| MYGDG(0) | The current, most recent generation |
| MYGDG(-1) | The previous one |
| MYGDG(+1) | A new one, created by this job |
| MYGDG.G0042V00 | An absolute generation, if you need to be specific |
Common mistakes
You will silently process the previous generation. The job succeeds and the output is wrong, which is worse than an abend.
Leaves an orphan entry that blocks the next allocation with a duplicate-name error.
Often the data is still on the volume; only the catalog entry was removed. It can usually be recatalogued.
What you will see at work
- LISTCAT is one of the first commands you will run in anger. LISTCAT LVL('PROD.PAY') shows everything under a qualifier.
- GDG limits are set when the group is defined. When old generations vanish unexpectedly, check the LIMIT and the SCRATCH option.
- Catalog problems are usually handled by storage administrators, but recognising one saves hours of looking in the wrong place.
Key terms
Check your understanding.
Take this lesson's quiz and save your progress. Free.