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

DB2 stored procedure - getting sqlcode -805


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

New User


Joined: 15 Jul 2008
Posts: 6
Location: Chennai

PostPosted: Fri Apr 09, 2010 12:09 pm
Reply with quote

Hi,

I am getting sqlcode -805 after call to stored procedure from online main program.

I have created stored procedure program and created parm list entry in sysibm.sysparms table. And compile both main and stored procedure program and bound with test region qualifier (DBT29) and concatenated the load library with online Job CICSABC

I am calling stored procedure PGMSP from main program PGMA as below

EXEC SQL CALL SYSPROC.DBT29.PGMSP (:parm List)
END-EXEC.

But after this call i am getting sqlcode -805.
Please help me on this if have any idea.
Back to top
View user's profile Send private message
Ranjithkumar

New User


Joined: 10 Sep 2008
Posts: 93
Location: India

PostPosted: Fri Apr 09, 2010 12:11 pm
Reply with quote

1. Are you using the correct PLAN?
2. Did you get any error message while binding?
Back to top
View user's profile Send private message
pdp123

New User


Joined: 15 Jul 2008
Posts: 6
Location: Chennai

PostPosted: Fri Apr 09, 2010 12:15 pm
Reply with quote

Hi,

1. I am using package to bind both main and SP program.
2. No error. Bind is successful for both Main And SP program.
Back to top
View user's profile Send private message
Ranjithkumar

New User


Joined: 10 Sep 2008
Posts: 93
Location: India

PostPosted: Fri Apr 09, 2010 12:35 pm
Reply with quote

Can you please check if there is a matching package in SYSPACKAGE? Use the following query:

Code:
                                             
 SELECT COLLID, NAME, HEX(CONTOKEN), VERSION 
 FROM SYSIBM.SYSPACKAGE       
 WHERE NAME = 'dbrm-name'                     
 AND HEX(CONTOKEN) = 'consistency-token';     
                                             


Use the below query if collection id is not balnk in your -805 message.

Code:


                                             
 SELECT COLLID, NAME, HEX(CONTOKEN), VERSION
 FROM SYSIBM.SYSPACKAGE     
 WHERE NAME = 'dbrm-name'                   
 AND HEX(CONTOKEN) = 'consistency-token'     
 AND COLLID = 'collection-id';               
                                             


If no rows are returned, the correct version of the package was not bound.
Back to top
View user's profile Send private message
pdp123

New User


Joined: 15 Jul 2008
Posts: 6
Location: Chennai

PostPosted: Fri Apr 09, 2010 2:30 pm
Reply with quote

Hi,

I ran above query, i got the package version which is matching with load module and dbrm module version of stored procedure.

Thanks,
Pradeep
Back to top
View user's profile Send private message
Ranjithkumar

New User


Joined: 10 Sep 2008
Posts: 93
Location: India

PostPosted: Fri Apr 09, 2010 3:54 pm
Reply with quote

Pradeep

I believe you have to do a double bind for this problem. If you post your BINDCARD / PKO I will try if i can suggest anything. It is best if you consult your DBA on what changes you have to do for the double bind.
Back to top
View user's profile Send private message
pdp123

New User


Joined: 15 Jul 2008
Posts: 6
Location: Chennai

PostPosted: Fri Apr 09, 2010 5:09 pm
Reply with quote

Hi Ranjith,

Bind card for stored procedure

Code:
BIND PACKAGE(SCOEL000) -
OWNER(DBDSCOP) -       
QUALIFIER(DBTSCOE) -   
MEMBER(SCOS0001) -     
CURRENTDATA(NO)-       
DBPROTOCOL(DRDA) -     
VALIDATE(BIND) -       
ISOLATION(UR) -         
FLAG(I) -               
PATH(DBTSCOE,SYSPROC) -
RELEASE(COMMIT) -       
EXPLAIN(YES);         


Bind card main pgm

Code:
BIND PACKAGE(SCOEL000) -
OWNER(DBDSCOP) -         
QUALIFIER(DBTSCOE) -     
MEMBER(SCO00012) -       
CURRENTDATA(NO)-         
DBPROTOCOL(DRDA) -       
VALIDATE(BIND) -         
ISOLATION(UR) -         
FLAG(I) -               
RELEASE(COMMIT) -       
EXPLAIN(YES);           


Thanks for your help. I will check with DBA here.

Thanks,
Pradeep
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 Invoke stored procedure via batch JCL. DB2 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts SQLCODE = -122 while using the scalar... DB2 4
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
Search our Forums:

Back to Top