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
 

 

SQLCODE -805 - Non DB2 Batch Program calling DB2 routine

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
insomniaa

New User


Joined: 07 Mar 2007
Posts: 11
Location: Milton Keynes

PostPosted: Fri Jul 20, 2007 7:55 pm    Post subject: SQLCODE -805 - Non DB2 Batch Program calling DB2 routine
Reply with quote

Hello everybody,

First of all, congratulations for such a nice and useful forum, I have been able to solve many issues going through the posts but I haven't been able to solve this one although I was able to find a few things regarding this issue but none of the has helped me.

Well, I have a non-DB2 batch program that per record read, calls up a DB2 routine to obtains for a customer all the accounts.

The first 15 records runs well, no problems at all, but when it reaches the 16th record, the program will abend with an SQLCODE=-805. After looking to the SQLCODE manual, we had requested our DBA's to rebound the plan for the batch program and also the plan for the routine but nothing....

I have verified the plan for the batch program and the routine is contained in the plan....

I could use some help.... it is very confusing....

Thanks again and congratulations for such a great forum!!!!

Leo
Back to top
View user's profile Send private message

socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Sat Jul 21, 2007 1:48 am    Post subject: Re: SQLCODE -805 - Non DB2 Batch Program calling DB2 routine
Reply with quote

Have you tried creating a new input dataset without the 16th record and running it?

Do you have any debugging tools, such as Expediter?

If so, trace the program execution and see what is happening on the 16th iteration that is different from the previous 15. The 16th must be doing unique. DB2 modules just don't disappear in the middle of execution! OK, they shouldn't disappear in the middle of an execution....
Back to top
View user's profile Send private message
Sandry

New User


Joined: 02 May 2006
Posts: 3

PostPosted: Sat Jul 21, 2007 11:43 am    Post subject:
Reply with quote

Is the first 15 records read from a dataset or is that too from table(database)
Back to top
View user's profile Send private message
insomniaa

New User


Joined: 07 Mar 2007
Posts: 11
Location: Milton Keynes

PostPosted: Mon Jul 23, 2007 11:08 pm    Post subject: Re: SQLCODE -805 - Non DB2 Batch Program calling DB2 routine
Reply with quote

Hello all,

It doesn't matter what information is within the record number 16th... it will get the same SQLCODE.... and it always happens in the 16th record when the routine tries to open the cursor....

I have been talking with our DBA's and it seems that the plan was bound with a different load program than the one used for execution... but still does not answer why is this happening with the 16th record.... and not with the first one....

Thanks for the response.... if we find the solution i will post it here....

Any advice will be helpful!!!!

Regards
Leo
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Mon Jul 23, 2007 11:54 pm    Post subject: Re: SQLCODE -805 - Non DB2 Batch Program calling DB2 routine
Reply with quote

I may have misunderstood you, but are you saying that the cursor isn't opened until the 16th record and that the first 15 do NOT open the cursor?
Back to top
View user's profile Send private message
insomniaa

New User


Joined: 07 Mar 2007
Posts: 11
Location: Milton Keynes

PostPosted: Wed Jul 25, 2007 2:02 pm    Post subject:
Reply with quote

Hi all,

Thanks for the answers... i have finally found the answers and it seems that the batch program was also connecting to our UDB database but never closing it therefore when read the next record and tried to open the cursor on the DB2 database, the system tried to open the cursor of a table on the wrong database thus receiving this -805....

Thanks!!!
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 Batch job tuning sgandhla Testing & Performance analysis 5 Fri Mar 24, 2017 9:41 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 am
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm


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