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

Reason for SQL Code -991?


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

New User


Joined: 06 Jul 2007
Posts: 2
Location: Hyderabad

PostPosted: Thu Feb 21, 2008 7:22 pm
Reply with quote

Hi Could any one please help me in finding the reasons about
SQL Code -991???

I have compiled sub program subPGM2 and then main program named MainPGM, which is using DB2. After that we ran the main program and its giving SQL code -991 for one of the sub program named subPGM (which was called by mainprogram MainPGM). We have modified only subPGM2 not other sub programs.

For compiling we are using tool LIMA.

Main program : MainPGM
Modified sub program : subPGM2 (Static call)
Effected sub program : subPGM1 (Dynamic call) is called subPGM
(Static call and we are getting sqlcode -991 in this program)

Why this error is coming only for Sub program not for mainprogram??

What is the reason for getting -991????

Thanks in Advance.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Feb 21, 2008 8:54 pm
Reply with quote

Have you looked at the fine manual?
Quote:
| -991 CALL ATTACH WAS UNABLE TO ESTABLISH AN IMPLICIT CONNECT OR OPEN TO
| DB2. RC1= rc1 RC2= rc2

| Explanation: Call attach attempted to perform an implicit connect and
| open as the result of an SQL statement. The connect or open failed with
| the returned values.

| System Action: The statement cannot be executed.

| Programmer Response: Verify that the application intended to use the call
| attachment facility (CAF) as the mechanism to connect to DB2. For stored
| procedures running in the WLM-established stored procedure address space
| the application must be link-edited with or dynamically allocate the RRS
| attachment language interface module (DSNRLI), not CAF.
Back to top
View user's profile Send private message
Hari Kishan

New User


Joined: 06 Jul 2007
Posts: 2
Location: Hyderabad

PostPosted: Fri Feb 22, 2008 3:08 pm
Reply with quote

Hi,

We have modified only subPGM2 and we are getting sql code:-991 for other sub program subPGM.

I have already gone through the programmer response.But I don't know how to verify this?

So can you please help me in this issue?

Programmer Response: Verify that the application intended to use the call
| attachment facility (CAF) as the mechanism to connect to DB2. For stored procedures running in the WLM-established stored procedure address space the application must be link-edited with or dynamically allocate the RRS attachment language interface module (DSNRLI), not CAF.

Thanks.
Back to top
View user's profile Send private message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Mon Feb 25, 2008 9:14 pm
Reply with quote

Well,
SQL -991 messge in manual shows something different. For me it turns out to be Link error.
I was breaking my head couple of days back and finally found tht the link libraries used in my compile JCL was not correct.
If you have endevor or changeman, try compiling your programs in them and use tht load module.
donot try to compile from a PDS JCL.
It solved my problem. Hope this helps.
Thanks,
Viji
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Reorg abended with REASON=X'00E40347' DB2 2
No new posts REASON 00D70014 in load utility DB2 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top