IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need Suggestion on -803 error code


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sambap

New User


Joined: 04 Apr 2014
Posts: 5
Location: India

PostPosted: Fri Apr 04, 2014 5:16 pm
Reply with quote

Hi,

I have cobol db2 program. there inserting the values into the table.

For some rows, though row not exist in the table I am getting -803 error(Unique index violation).

Could you please suggest, what could be the reason?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Apr 04, 2014 5:29 pm
Reply with quote

How are you inserting values into the table?

Are you reading the file and inserting the data from the file?
Back to top
View user's profile Send private message
sambap

New User


Joined: 04 Apr 2014
Posts: 5
Location: India

PostPosted: Fri Apr 04, 2014 5:32 pm
Reply with quote

Yes reading the file and doing some alternations as per the requirement and inserting into the table.
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Fri Apr 04, 2014 5:32 pm
Reply with quote

Hi,

Have you tried to research on -803 to find out the reason?

A simple google would have given you the answer

sambap wrote:
-803 error(Unique index violation).

Could you please suggest, what could be the reason?


When it say Unique index violation that means you are trying to insert something duplicate which needs to be unique

Check your data and fight out which values you are trying to insert duplicate
Back to top
View user's profile Send private message
sambap

New User


Joined: 04 Apr 2014
Posts: 5
Location: India

PostPosted: Fri Apr 04, 2014 5:39 pm
Reply with quote

Hi,

After doing all fight..I reached here Chandan.

I tested with the sample data also, row was not present before inserting. But still getting -803
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Apr 04, 2014 5:46 pm
Reply with quote

Does your file contain unique records?
Back to top
View user's profile Send private message
sambap

New User


Joined: 04 Apr 2014
Posts: 5
Location: India

PostPosted: Fri Apr 04, 2014 5:47 pm
Reply with quote

Yes..It is having unique records.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Apr 04, 2014 5:52 pm
Reply with quote

sambap wrote:
Yes..It is having unique records.



I am afraid the file read is not ok

Could you post the code within code tags?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 04, 2014 7:55 pm
Reply with quote

you receive a -803 when you attempt to insert a duplicate.

either you have dups in your input, or you have a logic error in your program,
because you are attempting to insert a row which is causing a duplicate index.

if you can not validate your input,
suggest you put in a few DISPLAYs in your program.

display record read.
display row to be inserted.
display db2 return code after insert.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top