IDCAMS condition code 8, 12 or 16 — and IDC3012I entry not found
IDCAMS reports every command with a condition code. 8 usually means 'not in the catalog' or 'already exists'; 12 and 16 mean the command could not run.
What happened
An IDCAMS step ended with a non-zero return code. The SYSPRINT output shows each command, the IDC messages it produced, and a condition code for that command. The step's return code is the highest condition code from the run.
DELETE LEARNER.TEST.KSDS CLUSTER PURGE IDC3012I ENTRY LEARNER.TEST.KSDS NOT FOUND IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 8 DEFINE CLUSTER (NAME(LEARNER.TEST.KSDS) ... IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
What it means
| Code | Meaning |
|---|---|
| 0 | The command did what you asked; there may be informational messages. |
| 4 | A minor problem; processing went on and nothing was damaged, e.g. LISTCAT could not find one entry. |
| 8 | The command ran but a major part was skipped — e.g. the entry to DELETE or ALTER was not in the catalog, or DEFINE found a duplicate name. |
| 12 | A logical error stopped the command: missing or conflicting parameters, or sizes (key length, record size, buffer space) that are wrong. |
| 16 | A severe error ended the whole command stream — for example SYSPRINT could not be opened, or IF-THEN-ELSE was coded wrongly. |
IDC3012I means the catalog search did not find the name you gave. If you did not name a catalog, the high-level qualifier must be a user catalog or one of its aliases. When catalog management itself returns an error, IDCAMS shows IDC3009I with a catalog return code and reason code; IBM documents those codes under IDC3009I in the MVS System Messages manual.
Typical causes
- 8 on DELETE — the first run of a delete/define job, or a rerun after the delete already worked.
- 8 on DEFINE — the name is already in the catalog from an earlier run.
- 12 — a typo or missing keyword in DEFINE CLUSTER, KEYS longer than the record, or contradictory options.
- 16 — missing or bad SYSPRINT DD, or a SET MAXCC/LASTCC=16 issued deliberately.
- IDC3012I for a name whose HLQ has no alias, so the search went to the master catalog.
Symptoms
- Step return code 8, 12 or 16; later steps skipped by COND or IF logic.
- Several IDC messages per command; the first error message is usually the real one.
Where to look
- The SYSPRINT of the IDCAMS step in SDSF — read it from the top, command by command.
- A LISTCAT ENTRIES(name) ALL to see whether the object exists and where it is cataloged.
- Any IDC3009I return/reason code, looked up in IBM's message manual.
How to diagnose
- Find the first command whose condition code is not 0.
- Read the IDC messages under that command; note IDC3012I, IDC3009I return and reason codes.
- Check whether the object should exist at that point in the job.
- For 12, compare the command with the syntax in Access Method Services documentation, keyword by keyword.
How to fix
Correct the command or the data name and rerun the step. In delete-then-define jobs it is common, and documented, to test the code and reset it so an expected 'not found' does not fail the step:
DELETE LEARNER.TEST.KSDS CLUSTER PURGE IF LASTCC = 8 THEN SET MAXCC = 0
Use this only where 8 is truly expected. SET changes LASTCC (the last command's code) or MAXCC (the highest so far); values over 16 become 16, and setting 16 ends processing.
How to prevent
- Make delete/define jobs rerunnable on purpose, with the condition-code test right after the DELETE.
- Define aliases for every HLQ that should resolve to a user catalog.
- Keep DEFINE statements in a controlled library rather than retyping them.
Production considerations
Interview question
Your IDCAMS step ended with RC 8. What does that tell you?
Stuck on something else?
Ask the community or search the full course.