Page 1 of 1

Finding the key of record causing DSNU344I while loading

PostPosted: Mon Feb 25, 2019 1:17 pm
by murthydvms
When loading the data to the table, I got below message in SYSPRINT stating existence of duplicate record:

DSNU344I  -DT11 055 03:18:34.55 DSNURBXA - UNIQUE INDEX KEY DUPLICATES KEY OF INDEXED RECORD
                      AT RID X'0030008201',
                           INDEX = DB2T.index_nm,
                           TABLE = DB2T.table_nm,
                           RECNO = 1,
                           RID   = X'0030012A02'


Is there any way to find the key of the record which resulted in above error? Also as per table definition, I see no column defined as USAGE SQL TYPE IS ROWID So what is the RID Hexadecimal value denotes?

Re: Finding the key of record causing DSNU344I while loading

PostPosted: Mon Feb 25, 2019 6:12 pm
by expat
When you sya load, is this an initial load where the receiving table is not populated, or is this adding data to the table.

If the former, then the error is in the input dataset, and a simple sort should find the duplicate key(s)

Re: Finding the key of record causing DSNU344I while loading

PostPosted: Mon Feb 25, 2019 7:49 pm
by murthydvms
Table has data in it, and I tried to load (APPEND) with the records that are already present in the table.

Punch card used:
LOAD DATA LOG NO NOCOPYPEND RESUME YES REUSE      
    INDDN SYSREC00 INTO TABLE DB2T.TABLE_NM


I'm looking for the meaning of RID in the DSNU344I message.

Re: Finding the key of record causing DSNU344I while loading

PostPosted: Tue Feb 26, 2019 11:19 pm
by murthydvms
Found the point I was looking for:

I got confused between ROW-ID and RECORD-ID (RID).

A row ID is a value that uniquely identifies a row in a table. A column or a host variable can have a row ID data type.


The RID function returns the record ID (RID) of a row. The RID is used to uniquely identify a row.


To find the record for which this error occurred:
Convert RID value from hexadecimal to decimal --> X'0030008201' to 805339649

then use it in the below query:
SELECT * FROM TABLE_NM
WHERE RID(TABLE_NM) =  805339649


For reference:
[LURL=]https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/sqlref/src/tpc/db2z_bif_rid.html[/LURL]
[LURL=]https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/sqlref/src/tpc/db2z_rowidvalues.html[/LURL]