Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 Block insert (-803 Error Handling)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
NJDevils28

New User


Joined: 11 Nov 2019
Posts: 3
Location: USA

PostPosted: Mon Nov 11, 2019 7:54 pm    Post subject: DB2 Block insert (-803 Error Handling)
Reply with quote

Hello All,

I am doing a Block insert after loading a Table, Approximately 2500 occurrences.

I am generating a Duplicate Key, Error -803. I found the duplicate and why it was generating but I would like to add some code to improve the down time in case it happens again.

Is there a way to capture the duplicate row after the error is generated using COBOL.

What I mean by this, after I do the insert and DB2 rejects the block insert and returns the -803. Aside from dumping the entire table and searching through it (occurrence my occurrence) for the Dupe. Can I capture the offending Key (Row) and display the table AND also the row # in error? That way I can go straight to that information and determine why it was duplicated.

Thanks,

-Ron
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2255
Location: Hampshire, UK

PostPosted: Mon Nov 11, 2019 9:12 pm    Post subject: Reply to: DB2 Block insert (-803 Error Handling)
Reply with quote

How abput sorting the data on the key and either remove duplicates or run through a program before doing the insert and report on duplicates. You may need to do a bit restructuring but it will save time eventually. 4 programs:
create data
sort
check
insert
Back to top
View user's profile Send private message
NJDevils28

New User


Joined: 11 Nov 2019
Posts: 3
Location: USA

PostPosted: Mon Nov 11, 2019 9:29 pm    Post subject: Re: Reply to: DB2 Block insert (-803 Error Handling)
Reply with quote

Nic Clouston wrote:
How abput sorting the data on the key and either remove duplicates or run through a program before doing the insert and report on duplicates. You may need to do a bit restructuring but it will save time eventually. 4 programs:
create data
sort
check
insert

Hi. Thank you for responding!

I thought of that but it will not work. (May not work)

There is the possibility of there being a pre-existing key during the bulk insert. My system is one of many that hits the database and I am supposed to be the primary but production and test environs rarely match.

Also, (and this is the primary error) I could have the key in the first Block insert and then a duplicate is created when I do my next Block insert.

The I/P data is supposed to be in the correct order but I'm having to code for that discrepancy also.

If there is a pre-existing key (Either another system insert or a previous block insert from me) and it's caught up in my current block insert - I need to ID the key and do a separate update.

That is where I am getting hung up and consuming too much time.

Any advice is most welcome!

-Ron
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2310
Location: NY,USA

PostPosted: Tue Nov 12, 2019 1:09 am    Post subject:
Reply with quote

I guess DB2_ROW_NUMBER should give you that row#, test it.

GET DIAGNOSTICS
Back to top
View user's profile Send private message
NJDevils28

New User


Joined: 11 Nov 2019
Posts: 3
Location: USA

PostPosted: Tue Nov 12, 2019 1:31 am    Post subject:
Reply with quote

Rohit Umarjikar wrote:
I guess DB2_ROW_NUMBER should give you that row#, test it.

GET DIAGNOSTICS

That looks like what I want!

Thank you!

-Ron
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2310
Location: NY,USA

PostPosted: Tue Nov 12, 2019 3:36 am    Post subject:
Reply with quote

Welcome Ron!!
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Not seeing the error panel )ATTR Harold Barnes TSO/ISPF 4 Fri Sep 20, 2019 10:56 am
No new posts End the job into error / abend state wik123 JCL & VSAM 3 Wed Sep 11, 2019 6:37 pm
No new posts WER027A Error Chinnadu SYNCSORT 8 Thu Aug 29, 2019 11:58 am
No new posts ISRE771 error while invoking macros pkmurali CLIST & REXX 5 Mon Aug 26, 2019 7:59 pm
No new posts Sort records within a data block rajiv rengasamy DFSORT/ICETOOL 0 Fri Jul 12, 2019 3:25 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us