Error codes and guides
Practical references for when something fails at work: what the message means, the usual causes, and how to fix it.
Error and abend codes
- S0C7 — data exceptionDecimal arithmetic or a numeric compare hit bytes that are not a valid number. The program is usually fine; the data is not.
- S0C4 — protection / addressing exceptionThe program touched storage it is not allowed to use — often a subscript out of range, a bad parameter list or a closed file.
- S806 — module not foundz/OS could not find the load module to run or load in any library the step searched.
- SB37 / SD37 / SE37 — out of spaceAn output dataset could not get more space. B37, D37 and E37 each fail for a different reason, so read the code before you change SPACE.
- S013 — dataset open failedA dataset could not be opened, usually because its attributes conflict with the program or JCL, or a member does not exist.
- U4038 — Language Environment abendLanguage Environment ended the program after an unhandled run-time error. The real cause is in the CEE and IGZ messages, not the code.
- SQLCODE -805 — package not foundDb2 could not find a package matching the program in any collection the plan searches. Nearly always a bind or deployment problem.
- SQLCODE -911 / -913 — deadlock or timeoutTwo units of work wanted the same locks. -911 means Db2 rolled your work back; -913 means it did not, and you must decide.
- ICH408I — RACF access deniedRACF refused an access. Read every field of the message and it tells you whose access, to what, and what is missing.
- ASRA — CICS program checkA program check inside a CICS transaction — the online equivalent of a batch S0C7 or S0C4. The interrupt code and offset lead you to the bad line.
- JCL ERROR — the job never ranThe system rejected the JCL or its allocations before the program ran. Different from a job that ran and failed.
- S0C1 — operation exceptionThe processor was asked to run bytes that are not a valid instruction — usually because control went to the wrong place.
- S0C2 — privileged-operation exceptionThe program tried to run an instruction only the operating system may use — in application code, a sign that control went to the wrong place.
- S0CB — decimal divide exceptionA packed-decimal divide failed — almost always because the divisor was zero; rarely the quotient was too large for the instruction's work area.
- S322 — CPU time limit exceededThe job or step used more CPU time than it was allowed. Find out whether it was looping or just had more work before raising TIME.
- SQLCODE -803 — duplicate key on insert or updateAn INSERT or UPDATE would create two rows with the same value in a unique index. Usually a reprocessed file or a key-generation problem.
- SQLCODE -811 — more than one row returnedA singleton SELECT INTO or a scalar subquery found more than one row. The data or the predicate is not as unique as the program assumed.
- SQLCODE -904 — resource unavailableDb2 could not use an object or resource, often a table space in a restricted state. The reason code and resource name tell you which and why.
- SQLCODE -180 / -181 — invalid date, time or timestampA date, time or timestamp was in the wrong format (-180) or out of range (-181). Usually spaces, low-values or a badly built date string.
- SQLCODE -530 — foreign key violationAn INSERT or UPDATE set a foreign key to a value with no matching parent row. Usually a load-order or missing-reference-data problem.
- MQRC 2035 — not authorizedAn MQI call was refused by security. Find which call failed, under which user ID, against which object.
- MQRC 2085 — unknown object nameThe queue manager could not find the queue or object the program named. Usually a name, case or environment mismatch.
- MQRC 2053 — queue fullA put failed because the queue reached its maximum depth. The real problem is usually the consumer, not the producer.
Trouble
- My job is not runningSubmitted, but nothing happens. A decision tree.
- My change did not take effectThe code is fixed, the job ran, and the behaviour is unchanged.
- A batch job that used to be fast is now slowSame job, same JCL, much longer elapsed time.
- Batch fails because CICS holds the fileA batch job cannot open a VSAM file because a CICS region has it open for update.
- A transferred file is unreadableText that looks fine on one platform is gibberish on the other.
- The job succeeded but produced nothingReturn code zero, empty or missing output. Often worse than an abend.
- Spool is filling upA system-wide condition that can stop new work across the whole system.
- Scheduled job failed overnight — scheduler failure workflowEnded not OK, stuck waiting or running late: how to read the scheduler, find the cause, and choose rerun, force complete or hold safely.
- Mainframe API errors — 400, 401, 403, 500, 503 and timeoutsA workflow for REST APIs served through z/OS Connect: read the status code, find the layer that failed, then fix the right thing.
FAQs
- I am completely new. What should I learn first?A realistic order that gets you useful fastest.
- Is it worth learning COBOL in 2026?An honest answer with the caveats attached.
- How do I practise without access to a mainframe?The access problem and the ways around it.
- Why does everyone talk about CPU cost?Because on this platform, consumption maps directly to a bill.
- Will I be the only newcomer on the team?What team composition is often like, and how to get the most from it.
- How do I know whether a program is batch or CICS?Three quick tells in the source.
- Who fixes what? A rough map of teamsKnowing who to ask saves more time than knowing the answer.
- Why is everything in capitals?A short answer with a genuinely useful consequence.
- Translating mainframe words into words you knowA rough dictionary for anyone arriving from another platform.
Command
- SDSF command referenceFinding, reading and managing jobs and system output.
- ISPF editor command referenceLine commands, primary commands, and the combinations that matter.
- TSO command referenceCommands you can run from ISPF option 6 or the READY prompt.
- IDCAMS command referenceDefining, copying, listing and deleting — VSAM and catalog operations.
- CEMT and CICS command referenceInspecting and controlling a CICS region.
- DB2 useful SQL and commandsCatalog queries and operator commands worth knowing.
- z/OS Unix command referenceStandard Unix, plus the z/OS-specific ones that matter.
- Zowe CLI commands you will use mostEveryday Zowe CLI commands for working with datasets and jobs from a terminal or a pipeline.
Jcl
- Copy a sequential datasetThe simplest useful job: IEBGENER with a new output dataset.
- Sort, filter and reformat in one stepDFSORT control cards doing what would otherwise be a program.
- A daily job using a generation data groupHow a job that runs every night produces a new output without changing its JCL.
- Conditional steps done clearlyIF/THEN/ELSE instead of COND, with a notification path on failure.
- Compile, bind and run a COBOL programThe three-step pattern, with the options that matter in test.
Cobol
- Read a file and produce totalsThe shape of most batch COBOL: open, loop, accumulate, close, report.
- Load a table and look values upOCCURS, INDEXED BY, SEARCH and SEARCH ALL, with the bounds problem handled.
- Read many rows with a cursor and commit safelyThe batch pattern: WITH HOLD, periodic commit, and a restart record.
- A pseudo-conversational CICS program skeletonThe template most CICS screens follow.
Dataset
- A worked dataset naming standardAn example convention, and how to read one you have been given.
- Allocating datasets: worked examplesThe four allocations you will need most, with the parameters explained.
- Defining and managing a GDGCreating the group, and what the options actually do.
Checklists
- First week checklistWhat to get sorted before you can be productive.
- Before you submit a jobNinety seconds that prevent most avoidable failures.
- COBOL code review checklistWhat to look for when reviewing someone's change, or your own.
- Overnight incident checklistWhat to do, in order, when something fails at 3am.
- Deployment checklistWhat must be in place before a change goes to production.
- Shift handover checklistWhat the next person needs to know, written so they do not have to ask.
- Pipeline readiness checklist for a mainframe applicationWhat to have in place before moving a COBOL application from manual promotion to a CI/CD pipeline.