Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Getting SqlCODE = -991 while opening cursor.

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

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Wed Jul 04, 2012 6:42 pm    Post subject: Getting SqlCODE = -991 while opening cursor.
Reply with quote

Hi,
I have declared following cursor
DECLARE CARIERL CURSOR FOR
SELECT STATUS,AC_No,POLICY_NO,STATE_NO,
ADDR_NO,EFFEE_ABC,EXP_ABC,
CONCAT(FRST_NAME, LAST_NAME)
AFIRST_NAME, BLAST_NAME,
DAYS(EXP_DAT) - DAYS(CURRENT DATE),
SEQ_NO,AOIOOO,UISEQ_NO
FROM Table
WHERE SEQ_NO IN (
SELECT A.SEQ_NO
FROM TANBLED A ,
TABB B
WHERE A.ID = 'TANTAN' AND
A.SEQ_NO = B.SEQ_NO AND
( B.ACC_TANTAN = 'ME&U' OR
B.ACC_TANTAN = 'ME&I' OR
B.ACC_TANTAN = 'ME&O' OR
B.ACC_TANTAN = 'ME&L' OR)) AND
( STATUS = 'ACT ' AND
(DAYS(EXP_DATE) - DAYS(CURRENT DATE) <= 890
AND DAYS(EXP) - DAYS(CURRENT DATE) >= 1 )
OR ( STATUS = 'ROTLU' AND
(DAYS(CURRENT DATE) - DAYS(EXP_DATE) <= 30
AND DAYS(CURRENT DATE) - DAYS(EXP_DATE) >= 1)))


while opening the above curosr i am getting SQLCODE = -991.

May u explain why I am getting such error. In spufi I am able to execute the above qurey properly
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1868
Location: UK

PostPosted: Wed Jul 04, 2012 6:50 pm    Post subject:
Reply with quote

When you look up the manual what does it say about -991? I could look it up but why should I when you can? and, do you not know about using code tags for displaying your code and adat?
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Wed Jul 04, 2012 6:52 pm    Post subject: Reply to: Getting SqlCODE = -991 while opening cursor.
Reply with quote

I am not getting anything for -991 when trying to serach in google

THe SQL table I am llooking for cursor issue has no such code.
I am getting followin ,
SQLERRMC = 0008 00F30034
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Wed Jul 04, 2012 6:55 pm    Post subject:
Reply with quote

SQLCODE -991, Error: CALL ATTACH WAS UNABLE TO ESTABLISH AN IMPLICIT CONNECT OR OPEN TO DB2.


How can i connect to DB2
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1775
Location: Bloomington, IL

PostPosted: Wed Jul 04, 2012 7:09 pm    Post subject:
Reply with quote

krunalbafna wrote:
SQLCODE -991, Error: CALL ATTACH WAS UNABLE TO ESTABLISH AN IMPLICIT CONNECT OR OPEN TO DB2.


How can i connect to DB2

Use a plan for which you're authorized.

BTW, since your Google-fu is obviously non-existent ("SQLCODE -991" gave me 4,250,000 hits), here is a link to the DB2 V10 troubleshooting guide. Enjoy
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Jul 04, 2012 7:13 pm    Post subject:
Reply with quote

lick you finger, stick it in the plug.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Wed Jul 04, 2012 7:14 pm    Post subject: Reply to: Getting SqlCODE = -991 while opening cursor.
Reply with quote

To answer your question, we have to guess:
1. In which program do you execute this SQL: is it a cobol program or rexx or something else ?
2. How do you run this program: with DSN or in EXEC PGM= or something else ?

You are not new on this Forum, you should know the rules! icon_evil.gif icon_evil.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Wed Jul 04, 2012 7:36 pm    Post subject: Reply to: Getting SqlCODE = -991 while opening cursor.
Reply with quote

Refer to http://ibmmainframes.com/about8550.html
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Wed Jul 04, 2012 7:37 pm    Post subject:
Reply with quote

Also look at below explanation,

Verify that the application intended to use the call attachment facility
(CAF) as the mechanism to connect to DB2. For functions or 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
preethan
Warnings : 1

New User


Joined: 15 Dec 2008
Posts: 33
Location: Chennai

PostPosted: Wed Jul 04, 2012 10:03 pm    Post subject: Re: Getting SqlCODE = -991 while opening cursor.
Reply with quote

Bind the program again with the id that you are running the program. The previous bind would have been done by some other user. Try and tell once

krunalbafna wrote:
Hi,
I have declared following cursor
DECLARE CARIERL CURSOR FOR
SELECT STATUS,AC_No,POLICY_NO,STATE_NO,
ADDR_NO,EFFEE_ABC,EXP_ABC,
CONCAT(FRST_NAME, LAST_NAME)
AFIRST_NAME, BLAST_NAME,
DAYS(EXP_DAT) - DAYS(CURRENT DATE),
SEQ_NO,AOIOOO,UISEQ_NO
FROM Table
WHERE SEQ_NO IN (
SELECT A.SEQ_NO
FROM TANBLED A ,
TABB B
WHERE A.ID = 'TANTAN' AND
A.SEQ_NO = B.SEQ_NO AND
( B.ACC_TANTAN = 'ME&U' OR
B.ACC_TANTAN = 'ME&I' OR
B.ACC_TANTAN = 'ME&O' OR
B.ACC_TANTAN = 'ME&L' OR)) AND
( STATUS = 'ACT ' AND
(DAYS(EXP_DATE) - DAYS(CURRENT DATE) <= 890
AND DAYS(EXP) - DAYS(CURRENT DATE) >= 1 )
OR ( STATUS = 'ROTLU' AND
(DAYS(CURRENT DATE) - DAYS(EXP_DATE) <= 30
AND DAYS(CURRENT DATE) - DAYS(EXP_DATE) >= 1)))


while opening the above curosr i am getting SQLCODE = -991.

May u explain why I am getting such error. In spufi I am able to execute the above qurey properly
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 Mainframe Opening in Chennai ( 2 to 4... muralikrishnan_new Mainframe Jobs 0 Tue Jul 18, 2017 2:20 pm
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Opening in Allianz India- T... Rajesh Gopinathan Mainframe Jobs 0 Wed Apr 19, 2017 11:33 am
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am

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