CICS Unit of Work Recovery: What to Check Before Retrying After a SYNCPOINT Failure
A CICS transaction that fails near `SYNCPOINT` leaves an important question: did the business update take effect, roll back, or reach an uncertain external boundary? This runbook explains how to collect enough evidence before anyone retries an online request or asks a customer to submit it again.
A CICS transaction that fails near SYNCPOINT leaves an important question: did the business update take effect, roll back, or reach an uncertain external boundary? This runbook explains how to collect enough evidence before anyone retries an online request or asks a customer to submit it again.
Trigger: a transaction fails after changing more than one resource
Consider a fictional address-change transaction. A CICS program validates a request, updates a DB2 customer row, writes an audit record to a recoverable VSAM file, and then issues EXEC CICS SYNCPOINT. The user sees an error screen or the terminal session ends unexpectedly.
The unsafe response is “try it again.” A retry may be correct, but only after determining what happened to the original unit of work (UOW). If the first request committed, a second request might create a duplicate audit event, send two downstream notifications, or overwrite a later update. If it rolled back, an unnecessary manual correction can introduce the inconsistency that CICS recovery was meant to prevent.
The examples are deliberately generic. Resource definitions, DB2 attachment behavior, recovery settings, logging, security, and support authority vary by site.
The decision that matters: was the UOW completed?
A UOW groups recoverable updates so CICS can make them durable together at a synchronization point, or back them out when the work cannot complete. In a straightforward CICS/DB2 flow, the program should avoid treating a successful SQL statement as proof that the business change is final. Before the synchronization point, that work may still be backed out with the rest of the transaction.
A useful support model is:
Request received
|
v
Validate -> update DB2 -> write recoverable audit record
|
v
SYNCPOINT requested
|
+-- successful completion -> UOW committed; do not resend blindly
|
+-- rollback/abend before completion -> investigate recovery outcome
|
+-- uncertain outcome -> preserve evidence and escalate before retry
The third branch deserves respect. A terminal error, an application dump, or an incomplete message in a log does not by itself prove whether the commit occurred. The question must be answered from controlled operational evidence, not from what the user remembers seeing on the screen.
Preconditions before the investigation starts
First, prevent two people from submitting the same request while the outcome is being checked. Record the transaction ID, approximate time, terminal or correlation reference if available, masked business key, user-facing request identifier, and the program version or release context. Keep this information in the incident or ticket under local data-handling rules; do not copy full customer records into broadly accessible notes.
Then establish the intended UOW boundary. Ask the application owner or inspect approved documentation: which updates are supposed to be atomic, which resources are recoverable, and are there any outbound actions that do not participate in the same rollback model? A DB2 update plus a recoverable file write may be designed as one UOW. An email, a HTTP call, a printer output, or an MQ message can need its own idempotency and recovery design. Do not assume every visible side effect automatically rolls back with CICS.
A compact COBOL/CICS pattern
This fragment shows the shape of an application-controlled synchronization point. It is not a complete program and does not replace local error conventions.
EXEC SQL
UPDATE CUSTOMER
SET ADDRESS-LINE-1 = :WS-ADDRESS-1,
POSTCODE = :WS-POSTCODE,
LAST-CHANGE-TS = CURRENT TIMESTAMP
WHERE CUSTOMER-ID = :WS-CUSTOMER-ID
END-EXEC
IF SQLCODE NOT = 0
PERFORM 9000-REPORT-DB2-ERROR
EXEC CICS SYNCPOINT ROLLBACK END-EXEC
PERFORM 9999-RETURN-TO-CICS
END-IF
WRITE AUDIT-RECORD
INVALID KEY
PERFORM 9100-REPORT-AUDIT-ERROR
EXEC CICS SYNCPOINT ROLLBACK END-EXEC
PERFORM 9999-RETURN-TO-CICS
END-WRITE
EXEC CICS SYNCPOINT END-EXEC
IF EIBRESP NOT = DFHRESP(NORMAL)
PERFORM 9200-REPORT-SYNCPOINT-ERROR
PERFORM 9999-RETURN-TO-CICS
END-IF.
```
The point is not to copy these paragraphs into every program. It is to make the intended branch visible: an application-detected failure requests rollback before the normal commit point. A failure reported around SYNCPOINT must be logged with enough context to investigate. In real code, also use the site-approved approach for RESP/RESP2, SQLCODE handling, error routines, and returning a safe message to the user.
A program should not issue rollback casually after an unknown failure and then declare the request absent. CICS recovery behavior depends on when the failure occurred and on the participating resources. The program’s error path and the operational evidence must agree.
Diagnosis path: assemble a small evidence bundle
Start with the CICS message, dump, or application log entry that identifies the task and failure. Capture the timestamp, transaction ID, program, EIBRESP/EIBRESP2 when available, SQLCODE, and any internal correlation ID. Next, use approved inquiry tools to determine whether the transaction abended, was rolled back, or completed normally. CICS system-management staff may need to interpret region messages or recovery-manager information; application support should not infer the result from one screen message.
For the business result, query or inspect the authoritative records using approved read-only support methods:
| Evidence | Question it answers | Do not assume |
| --- | --- | --- |
| DB2 row and audit timestamp | Did the intended database state change? | A row exists only because of this request; compare the request reference and time. |
| Recoverable audit or VSAM record | Did the matching internal audit event survive? | A missing audit row proves rollback if the audit write was optional or asynchronous. |
| CICS task and error evidence | Did the task abend, roll back, or finish? | A terminal disconnect equals rollback. |
| Outbound-message or interface status | Did an external consumer receive an effect? | A committed database update automatically means the notification was delivered. |
| Prior retry history | Has the request already been resent? | The current user is the only actor. |
A consistent set of records is stronger than a single clue. For example, a DB2 row with the request’s unique reference, a corresponding recoverable audit record, and a normal completion indication support “committed.” If all intended updates are absent and the task shows a rollback before completion, retry may be appropriate after the underlying fault is corrected. Mixed evidence is an escalation condition, not a reason to choose the more convenient answer.
Handling external effects separately
An especially common design trap is to combine a recoverable update with a non-transactional side effect and call the whole operation atomic. Suppose the address change commits, but a downstream notification call times out. Retrying the complete CICS transaction can update the address again and may send duplicate notifications.
A safer design records a stable request ID with the business update and treats the notification as a separately tracked action. The receiver can reject a repeated request ID, or a recovery process can identify an unsent notification from its status. This is an idempotency design decision, not a support workaround. It should be tested and approved before production use.
Before retry: support checklist
- [ ] Freeze duplicate user submission while the first request is investigated.
- [ ] Preserve task, time, transaction ID, program, masked business key, correlation ID, and error codes.
- [ ] Confirm the intended UOW boundary and identify every recoverable and external resource involved.
- [ ] Check authoritative DB2 and audit evidence using approved read-only procedures.
- [ ] Establish whether a notification, message, or other external effect was attempted, accepted, or remains unknown.
- [ ] Classify the outcome as committed, rolled back, or uncertain; escalate uncertain or mixed cases.
- [ ] Correct the technical or data cause before a controlled retry.
- [ ] For a retry, use the normal transaction path and the approved request identifier; do not perform direct production data changes to imitate it.
- [ ] Record the final disposition and reconciliation evidence in the incident record.
Do not delete audit data, force a DB2 change, or rerun a related batch merely to make the records appear aligned. Those actions can destroy the very evidence needed to resolve the original failure.
Practical takeaway
SYNCPOINT is the boundary that turns several tentative changes into a business outcome. When a CICS task fails near that boundary, support should first establish the UOW result from evidence, then address any separate external effect, and only then decide whether a controlled retry is safe.