Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need Suggestion on -803 error code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Need Suggestion on -803 error code
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

Moderator


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

PostPosted: Fri Apr 04, 2014 5:29 pm    Post subject:
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    Post subject:
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: 269
Location: Mumbai

PostPosted: Fri Apr 04, 2014 5:32 pm    Post subject: Re: Need Suggestion on -803 error code
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    Post subject:
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

Moderator


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

PostPosted: Fri Apr 04, 2014 5:46 pm    Post subject:
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    Post subject:
Reply with quote

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

Moderator


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

PostPosted: Fri Apr 04, 2014 5:52 pm    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Apr 04, 2014 7:55 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us