Learn it on Mainframe Path. Do it with Mainframe KIT.Learn on Mainframe Path ▸
Mainframe KIT ● Nothing leaves this tab

DUPREC

DFHRESP(DUPREC) = 14CICS RESP CONDITION · CHECKED 2026-11-14
Checked against IBM documentation

A WRITE tried to add a record whose key already exists in the file.

QUICK ANSWER

A WRITE tried to add a record whose key already exists in the file.

LIKELY CAUSES, IN THE ORDER OF THIS ENTRY

  1. The key being written already exists in the file.
  2. The WRITE goes through a path with the UNIQUEKEY attribute and the key already exists.
  3. On a coupling facility data table using the contention model, DUPREC is raised even if another task has read the record with that key for update.

CHECKED 14 Nov 2026 IBM: WRITE (CICS Transaction Server for z/OS 6.x) · EXEC interface block (EIB) fields (CICS Transaction Server for z/OS 6.x)

MOST LIKELY

The key being written already exists in the file.

FIRST CHECK

Test RESP after the WRITE and treat DUPREC as 'record already exists'.

TRY IT ▸

Site search

What it means

DUPREC is RESP 14 with RESP2 150 on WRITE. It means the record's key already exists in the file, or in a path over the file that has the UNIQUEKEY attribute.

The default action is to end the task abnormally.

Typical causes

  • The key being written already exists in the file.
  • The WRITE goes through a path with the UNIQUEKEY attribute and the key already exists.
  • On a coupling facility data table using the contention model, DUPREC is raised even if another task has read the record with that key for update.

How to fix it

  1. Test RESP after the WRITE and treat DUPREC as 'record already exists'.
  2. Check how the key is generated and whether it can repeat.
  3. Code RESP so the task does not end abnormally.

Example

Illustrative only; names and values are invented.

EXEC CICS WRITE FILE('CUSTFIL') FROM(WS-CUST) RIDFLD(WS-KEY)
     RESP(WS-RESP) RESP2(WS-RESP2) END-EXEC
IF WS-RESP = DFHRESP(DUPREC)
   MOVE 'CUSTOMER ALREADY EXISTS' TO MSGO
END-IF