What it means
RESP 15 (RESP2 140) is a warning, not a failure: the READ or READNEXT returned a record through an alternate index defined with non-unique keys, and another record with the same key follows.
It is not raised for the last record with that key. If the program does not test RESP for it, CICS ends the task abnormally, which is why it often surprises people.
Typical causes
- Reading by an alternate key such as a surname or postcode, where many records share the same value.
- A path or alternate index was rebuilt with non-unique keys and the program assumed unique keys.
- The program uses HANDLE CONDITION or RESP checks that treat anything other than NORMAL as an error.
How to fix it
- Treat DUPKEY like NORMAL for the record you got: the data in the INTO area is valid.
- To see the other records with the same key, browse with STARTBR and READNEXT until DUPKEY stops.
- Review error checks so that DUPKEY is not reported as a file error.
- If the key must be unique, check the alternate index definition with whoever owns the data set.
Example
Illustrative only; names and values are invented.
IF WS-RESP = DFHRESP(NORMAL) OR WS-RESP = DFHRESP(DUPKEY)
PERFORM 2000-SHOW-RECORD
END-IF