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
 
Seeking Resolution for SQKCODE -991 on Open Cursor

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

New User


Joined: 22 Jun 2020
Posts: 1
Location: USA

PostPosted: Mon Jun 22, 2020 8:25 pm    Post subject: Seeking Resolution for SQKCODE -991 on Open Cursor
Reply with quote

I am receiving a SQLCODE -991 on an OPEN CURSOR statement. The OPEN is in a COBOL program initialization process. The program is not called by another program. The format of the open is:
EXEC SQL
DECLARE cursor-name CURSOR FOR
SELECT column-name1, column-name2, …
FROM table-name
WHERE column-name = 0
ORDER BY column-name
END-EXEC
immediately after issuing the Coen statement, the SQLCODE is checked and that is when the -991 is detected.
Back to top
View user's profile Send private message

sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 803
Location: Maryland

PostPosted: Mon Jun 22, 2020 10:14 pm    Post subject:
Reply with quote

RTFM:

IBM Knowledge Center
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. rc1The value returned in FRBRC1 for the failed CONNECT or OPEN request.rc2 The value returned in FRBRC2 for the failed CONNECT or OPEN request.


System action

The statement cannot be processed.


Programmer response

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.


SQLSTATE

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

Senior Member


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

PostPosted: Tue Jun 23, 2020 7:13 pm    Post subject:
Reply with quote

Your login ID needs a GRANT access to the Plan.
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 VSAM Open During Copy-Excessive EXCP ... David Beckham JCL & VSAM 1 Sat Jun 27, 2020 5:23 pm
No new posts Multiple rows within Cursor when Coun... iamdijkstra007 DB2 14 Mon Jun 08, 2020 12:53 am
No new posts Need to open a DSN using REXX & e... Y Marwaha CLIST & REXX 10 Fri Jun 05, 2020 7:30 pm
No new posts Dynamic cursor name in Cobol program Jlevine COBOL Programming 1 Fri Feb 14, 2020 2:55 am
No new posts Enabling Crosshair cursor in mainframe priya_t23 TSO/ISPF 2 Wed Nov 06, 2019 11:29 am

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