IBM Support

Editor Error 694, VSAM File Status 22

Troubleshooting


Problem

Editor Error 694, VSAM File Status 22

Symptom

An attempt was made to write a record that would create a duplicate key in a relative file:
or 
an attempt was made to write or rewrite a a record that would create a duplicate prime record key or a duplicate alternate record key with the DUPLICATES phrase in an indexed file.  
 
Gentran:Basic, All Releases 
Error could occur in Editors (EBDI001, EBDI002, EDIR001, or EDIR002) 
Error could occur in Mappers (EBDI041, EBDI042, EDIR041, or EDIR042) 
Error could occur in a Databank Directory File (EDIIEA, EDIOEA, EDIIAA, EDIOAA, EDIRIEA, EDIROEA, EDIRIAA, or EDIROAA) 
Error could occur in a Databank Message Store File (EDIIES, EDIOES, EDIIAS, EDIOAS, EDIRIES, EDIROES, EDIRIAS, or EDIROAS)  
 

Error Message


Error: 694 Databank Add Failed
FS22 
VSAM FILE STATUS 22 Duplicate Key 

Resolving The Problem

Solution
1. Identify the cause of corrupted H Record (Column 1 = H) in the Databank Directory. 
Probable cause is failure of a previous Gentran process (e.g., EBDI001 Abend B37) or failure in previous non-Gentran process (e.g., IDCAMS Reorg File Status 23). Any process that manipulates the Databank Directory or Message Store File is suspect. One common cause is restoring the Databank Director File without restoring the Databank Message Store File (see #3, below).

2. If the cause is failure of previous Gentran process (e.g., EBDI001 Abend B37):  
Run Gentran Housekeeping (EXEC101, EXEC201, EXEC301, or EXEC401). 
Housekeeping cleans up the Interrupt Records, left behind by the failure of a previous Gentran process.

3. If the cause is failure of non-Gentran process:  Restore the Databank Directory File & associated files.
See Databank Files chapter in the Technical Reference Guide for details. The linkage between Databank Files is complex and critical, so pay close attention to the Data Set Recovery instructions. If necessary, follow the thread of files.
For example: Before restoring the EDIIEA File, review Data Set Recovery for EDIIEA, EDIIES, EDIIECA, EDIIEP, and EDIQ097.

4. As a last resort: Manipulate the H Record in the Databank Directory File. 
*** This is a drastic solution, to be used only as a last resort. ***
a. Identify the Last Databank Run Number and Unique Number in the H Record, using copybook IEAHRC, OEAHRC, IAAHRC, or OAAHRC.
b. Add 1 to the Last Databank Run Number
c. Add x+1 to the Unique Number
... x+1 is related to the number of Header Envelope Segments that were processed during the failing run. 
The algorithm: x+1 = 1 + (1 * Interchanges) + (2 * Groups) + (1 * Transactions). 
For example, if the failing run processed 1 Interchange, 1 Group, and 1 Transaction: x+1 = 5 = 1 +  (1 + 2 + 1) = 1 + (1 * 1 Interchange) + (2 * 1 Group) + (1 * 1 Transaction). Round up, to be safe, or if exact numbers are not available. 

[{"Product":{"code":"SS6UG9","label":"Sterling Gentran for z\/OS"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"6.4;6.5;6.6","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

TRB1701

Document Information

Modified date:
16 June 2018

UID

swg21561259