SQLCODE = -803 when exporting Gen 8.6 HE model to PI tables
search cancel

SQLCODE = -803 when exporting Gen 8.6 HE model to PI tables

book

Article ID: 442810

calendar_today

Updated On:

Products

Gen - Host Encyclopedia Gen

Issue/Introduction

Attempted export of model from Gen 8.6 Host Encyclopedia (HE) to Public Interface (PI) tables fails with a duplicate value error during the INSERT INTO USE_DATA_SENT or INSERT INTO USE_DATA_RTND phase.
In this example the error is:
*****

     RUN PROGRAM(TIPTABLX) PARMS ('STACK(70K),/DEBUG=') LIB   ('D0IEF.C86.LOAD') PLAN (CG86TABL)
 DSN
   END
 READY
 END
 ERROR condition was raised
 Traceback of user routines:
 Compile Unit   Entry          Statement  CU offset   Entry offset  Address
                TIPTBAB        571        +0000A202   +0000A202     1D81DC12
                TIPTABL        375        +000021E4   +000021E4     1D7F091C
1MODEL:  MODEL1
 SQL statement follows:
 INSERT INTO USE_DATA_SENT                       /**/                          VA
  TIME:  10:11:23.026
  DATE:  2026-06-01
  USER:  USER123
  PROCEDURE WHERE ERROR OCCURRED: TIPTBAB
  THE SQLCA CONTAINED THE FOLLOWING DATA:
  SQLERRM:  PIDATAI1Ÿ0000C73852
  SQLERRD(3):          0


  DSNT408I SQLCODE = -803, ERROR:  AN INSERTED OR UPDATED VALUE IS INVALID
           BECAUSE INDEX IN INDEX SPACE PIDATAI1 CONSTRAINS COLUMNS OF THE TABLE
           SO NO TWO ROWS CAN CONTAIN DUPLICATE VALUES IN THOSE COLUMNS.
           RID OF EXISTING ROW IS X'0000C73852'.
  DSNT418I SQLSTATE   = 23505 SQLSTATE RETURN CODE
  DSNT415I SQLERRP    = DSNXRINS SQL PROCEDURE DETECTING ERROR
  DSNT416I SQLERRD    = -110  13172739  0  13817814  -490143744  0 SQL
           DIAGNOSTIC INFORMATION
  DSNT416I SQLERRD    = X'FFFFFF92'  X'00C90003'  X'00000000'  X'00D2D7D6'
           X'E2C90000'  X'00000000' SQL DIAGNOSTIC INFORMATION
 ONLOC     = TIPTBAB
 ONCODE    =         9
*****

Environment

  • Gen Host Encyclopedia

  • Export model to Public Interface tables

Cause

Model corruption resulting in duplicate view mapping for an ACBLKUSE statement. There are duplicate DVUIS objects with DESTFOR, SRCEFOR, and MAPDIMP associations to the same ACBLKUSE object.

Support advised to re-run the PI export in batch and before submitting the JCL edit it to change string /DEBUG= to /DEBUG=CSPD
From debug output the export is trying to insert a row for object id 1347874882 and its association to a DVUIS (Object Type Code 106) twice which causes the duplicate row error:
*****
...
 OBJ ID=1347874854 OTC=        106
  END OF TIPFPRP 075158184
 07.51.58.184 07.51.58.184 TIPTBAB ,    0INSERT INTO USE_DATA_SENT                       /**/                          VA
 07.51.58.184 07.51.58.184 TIPTBAB ,    0FETCH DVUISSN      INTO                                                        /
  TIPFPRP: MAIN PROGRAM 075158184
 OBJ ID=1347874882 OTC=        106
  END OF TIPFPRP 075158184
 07.51.58.184 07.51.58.184 TIPTBAB ,    0INSERT INTO USE_DATA_SENT                       /**/                          VA
 07.51.58.184 07.51.58.184 TIPTBAB ,    0FETCH DVUISSN      INTO                                                        /
  TIPFPRP: MAIN PROGRAM 075158184
 OBJ ID=1347874882 OTC=        106
  END OF TIPFPRP 075158184
 07.51.58.184 07.51.58.184 TIPTBAB , -803INSERT INTO USE_DATA_SENT                       /**/                          VA
 GETUID : USERID =       USER123
 SQL statement follows:
 INSERT INTO USE_DATA_SENT                       /**/                          VA
  TIME:
 TIUTMCC: MAIN ROUTINE EXECUTING 07:51:58.184
  DATE:  2026-06-02
  USER:  USER123
  PROCEDURE WHERE ERROR OCCURRED: TIPTBAB
  THE SQLCA CONTAINED THE FOLLOWING DATA:
  SQLERRM:  PIDATAI1Ÿ0000F81257
  SQLERRD(3):          0


  DSNT408I SQLCODE = -803, ERROR:  AN INSERTED OR UPDATED VALUE IS INVALID
           BECAUSE INDEX IN INDEX SPACE PIDATAI1 CONSTRAINS COLUMNS OF THE TABLE
           SO NO TWO ROWS CAN CONTAIN DUPLICATE VALUES IN THOSE COLUMNS.
           RID OF EXISTING ROW IS X'0000F81257'.

*****

Resolution

Run the following SQL against the HE to identify the offending objects (replace 'YOUR MODEL' with the actual model name):

*****
   SELECT                                                            
        A.ASSOC_FROM_OBJ_ID,                                         
        B.ASSOC_FROM_OBJ_ID,                                         
        C.ASSOC_FROM_OBJ_ID                                          
   FROM                                                              
        DOBJ D, DMDL,                                                
        DASC B, DASC C, DASC A                                       
WHERE MODEL_NAME = 'YOUR MODEL'                                      
  AND D.OBJ_MODEL_ID           = MODEL_ID                            
  AND D.OBJ_TYPE_CODE          = 106                                 
  AND D.OBJ_ID                 = B.ASSOC_TO_OBJ_ID                   
  AND B.ASSOC_TYPE_CODE        = 259                                 
  AND C.ASSOC_TYPE_CODE        = 56                                  
  AND A.ASSOC_TYPE_CODE        = 219                                 
  AND A.ASSOC_TO_OBJ_ID        = B.ASSOC_TO_OBJ_ID                   
  AND A.ASSOC_TO_OBJ_ID        = C.ASSOC_TO_OBJ_ID                   
  GROUP BY A.ASSOC_FROM_OBJ_ID,                                      
         B.ASSOC_FROM_OBJ_ID,                                        
         C.ASSOC_FROM_OBJ_ID                                         
  HAVING COUNT(*) > 1;    
*****

Output for this example:
                                       +-----------------------------------------------------------+
                                       | ASSOC_FROM_OBJ_ID | ASSOC_FROM_OBJ_ID | ASSOC_FROM_OBJ_ID |
                                       +-----------------------------------------------------------+
                                     1_|     1347874882    |     1347874865    |     1543147438    |
                                     2_|     1347874993    |     1347874865    |     1543147438    |
                                     3_|     1347875193    |     1347874865    |     1543147438    |
                                     4_|     1347875512    |     1347874865    |     1543147438    |
                                       +-----------------------------------------------------------+

The 3 output columns represent object types ACBLKUSE, ENTVW, ENTVW respectively. 
The SQL finds duplicate view mapping for an ACBLKUSE statement i.e. identifies duplicate 'DVUIS' objects with 'DESTFOR', 'SRCEFOR' and 'MAPDIMP' associations to the same 'ACBLKUSE' OBJECT.
To fix the problem use utility TIEWENCY (Host Encyclopedia Utilities) on each ACBLKUSE object id in the first column to find the calling and called action block names and then redo the view matching in the Gen Toolset.

Here are some example TIEWENCY screenshots from the Gen sample model where there is no duplication but gives an idea on what will be seen and how to find the called/calling action blocks:

  1. On initial screen enter ACBLKUSE object id into the Object ID field and hit enter:


  2. On the next screen the corresponding ACBLKUSE object type should be visible:


  3. Then use S on the ACBLKUSE line to get to the next screen showing the called action block (< REFDBY ...) and calling action block (< CONTAINS ...):


  4. All the ACBLKUSE object ids listed in the first column of the SQL output need to be checked in the same way.

  5. Create and download a subset from the HE containing all the relevant called/calling action block pairs.

  6. Open the subset in the Gen Toolset and for each pair of called/calling action blocks unmatch the views and rematch them.

  7. Upload the changes to the HE.

  8. Re-run the SQL and it should not return any rows.

  9. Run the export to PI again.

Additional Information

NOTE: If the message when the error occurs is "INSERT INTO USE_DATA_RTND", then in the above SQL the A.ASSOC_TYPE_CODE value should be changed to 217 instead of 219.