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

SQL RETURN CODE: 919


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

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Thu Mar 22, 2012 5:18 am
Reply with quote

Hi All,
I am trying to run a COBOL DB2 program which has cursors defined in them. In the program the cursor is opened but thereafter the program abends.
SQL RETURN CODE: 919

Any chance anyone else in this forum came across a similar situation ?

Appreciate any help!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 22, 2012 10:50 am
Reply with quote

Hello,

At the top of the page is a link to "IBM Manuals". On that page select one of the DB2 Messages and Codes. Search for -919 and read about the return code.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 22, 2012 5:30 pm
Reply with quote

I believe, it might have been -919 (notice the "-", bold did not make it that obvious, phew!), as Dick has rightly indicated.
Back to top
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Thu Mar 22, 2012 8:15 pm
Reply with quote

The return code I am receiving is + 919 and not -919. I tried searching for +919 but could not find much on the internet. Any help please ?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 22, 2012 8:26 pm
Reply with quote

ramangouda patil wrote:
The return code I am receiving is + 919 and not -919. I tried searching for +919 but could not find much on the internet. Any help please ?
How are you sure about it?

I hope you know what do positive-SQLCODEs mean, actually? Do yo uhave SQLSTATE handy with you?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Mar 22, 2012 8:33 pm
Reply with quote

show us the code and data definitions that you are using to display the sqlcode.

and then we will explain to you why you are wrong, it is -919.
there is no +919 sqlcode on z/OS DB2.
thus you will find nothing on the internet for a +919
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Mar 22, 2012 8:34 pm
Reply with quote

What is the SQLSTATE at the time of abend?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Thu Mar 22, 2012 8:34 pm
Reply with quote

ramangouda patil wrote:
The return code I am receiving is + 919 and not -919. I tried searching for +919 but could not find much on the internet. Any help please ?

Given that there is no +919 SQLCODE listed in the DB2 10 for z/OS Troubleshooting Guide, I think that I may be forgiven my doubts as to the accuracy and veracity of your story. Would you like to try again?
Back to top
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Thu Mar 22, 2012 9:09 pm
Reply with quote

Hi All,
Posting the code and error message. I asked for help with the system administrator, but could not get any lead on the 919 code. Thus trying other options.

Code:
[* SQL RETURN CODE:    919  *    ]

[ WS-SQL-CODE                     PIC ZZZZ9-.]
[EXEC SQL                           
    DECLARE E5100CR CURSOR FOR     
    SELECT                         
           TLENTYID           ,   
           CKVAL              ,   
           CKVAL              ,   
           NVCDISTLINENBR     ,   
           NVCDISTSEQ         ,   
           MTNBR              ,   
           VENTCD             ,   
           UBEVENTCD          ,   
           CTVYCD             ,   
           AXAUTHCD           ,   
           CKVAL              ,   
           EAMT               ,   
           SERRSRVREF         ,   
           CCTEFFDT               
    FROM   COBGNX.TCE5100           
          FOR FETCH ONLY
           END-EXEC. ]

In Procedure division:
[ EXEC SQL           
     OPEN E5100CR   
 END-EXEC.          ]

[IF SQLCODE = 0                                         
    NEXT SENTENCE                                     
  ELSE                                                 
    MOVE  SQLCODE TO WS-SQL-CODE                       
    DISPLAY '* SQL RETURN CODE:  ' WS-SQL-CODE ' *'   
    GO TO EOJ                                         
END-IF.                                                ]
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Mar 22, 2012 9:24 pm
Reply with quote

What is the Cobol PIC for WS-SQL-CODE?

What is the valuse of SQLSTATE (I will not ask again).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Mar 22, 2012 9:46 pm
Reply with quote

batch or cics?

you mentioned that your db2 program had cursors.
how many other cursors where open at the time you opened this cursor?


Code:
WS-SQL-CODE PIC ZZZZ9-.

Code:
* SQL RETURN CODE: 919 *

Code:
DISPLAY '* SQL RETURN CODE: ' WS-SQL-CODE ' *'


by the way you are BSing us.

if your pic clause was truely as you said, and your code was truely as you said,
this
Code:
* SQL RETURN CODE: 919 *

would be this:
Code:
* SQL RETURN CODE:   919  *
Back to top
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Fri Mar 23, 2012 12:48 am
Reply with quote

Hello,
Code:
The PIC clause is
[WS-SQL-CODE                     PIC ZZZZ9-. ]

The SQLCODE and SQLSTATE is
[* SQL RETURN CODE:    919  *]
[* SQL STATE  CODE:      0  * ]


using the DISPLAY statements in the program :
[DISPLAY '* SQL RETURN CODE:  ' WS-SQL-CODE ' *']
[DISPLAY '* SQL STATE  CODE:  ' WS-SQL-STATE' *']

This is as is copied from the program and the spool output. I am stating the issue as is and this is not made up in anyway. Kindly let me know if I can provide more details to be clearer with the issue.

Thanks!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Mar 23, 2012 1:10 am
Reply with quote

rarely does an OPEN Cursor generate a -919.
a +919 does not exist in z/OS DB2 (as of vsn10, which is the latest)
i would venture to say, that SQLSTATE = 0 never occurs on an SQLCODE <> 0

ok.

1. what kind of machine are you running on?
2. what version of db2 are you running?
3. Batch or CICS?
4. I asked about other cursors in your program.
5. i don't like excerpted code, what is the flow of your program?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Mar 23, 2012 1:25 pm
Reply with quote

Just a guess: is your COBOL program meant to fetch data from some DWH (Data Ware House) tables, possibly, involving Informatica?
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Thu Mar 29, 2012 6:23 pm
Reply with quote

-919 A ROLLBACK OPERATION IS REQUIRED

Explanation:

The unit of work was placed in a state where a rollback operation is
required. This can happen for the following reasons:

o An SQL statement updated a distributed database server, but the
database server can be used only for read-only operations. Either
updates are currently restricted to servers that support distributed
two-phase commit and this application server does not support
distributed two-phase commit, or updates are restricted to a single
server that does not support distributed two-phase commit and this
application server is not that server.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 29, 2012 6:42 pm
Reply with quote

Actually, so far, we're still advocating on if it's +919 or -919. Though, OP, ramangouda, has not returned yet.
Back to top
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Fri Mar 30, 2012 10:02 pm
Reply with quote

Sorry All,
Was not able to reply earlier. The SQL code is definately 919 (dont see any negative sign in the SQLCODE output).

The DB2 version we have is 8.1
The machine is z/OS version 1.9
We are running the program through batch.
There are other cursors defined, but this issue is happening on the first cursor that we are trying to open.
The program flow is basically displaying a few statements to spool(which the program is doing) and then trying to open the cursor, read through the cursor and move the read values into working variables. What is happening is after trying to open the cursor, we are catching the SQLCode and then going into error handling it to display appropriate messages and then end of program.

Kindly let me know if I need to provide more details.
Again thanks for the assistance.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2012 10:38 pm
Reply with quote

Hello,
Quote:

The SQL code is definately 919
Most of us are doubtful that DB2 is returning a "919" as it is not documented anywhere in the DB2 material. . .

Suggest you copy this program and remove everything except this problem bit of code and run it. You would only keep the definitions for the cursor and whatever is needed to fetch rows.

Make sure the sqlcode is set to zero before issuing any sql statements.
Back to top
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Sat Mar 31, 2012 2:15 am
Reply with quote

Hi All,
Below is snippet form the spool output for couple of cursors. the second and third gave an error of -991 but the first shows 919.

Code:
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*   
* SQL RETURN CODE:    919  *             
* ERROR OPENING  CRS3E00 CSR        *   
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*   
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*   
* SQL RETURN CODE:    991- *             
* ERROR CLOSING  CRS3E00 CSR        *   
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*   
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*   
* SQL RETURN CODE:    991- *             
* ERROR CLOSING  CRS028  CSR        *   
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*   
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Mar 31, 2012 2:24 am
Reply with quote

what does the jcl for the job step look like?

What do the other cursors do?


since this is batch,
and you have pretty long cursors,
do you ever commit?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Mar 31, 2012 10:37 pm
Reply with quote

ramangouda patil wrote:
Hi All,
Below is snippet form the spool output for couple of cursors. the second and third gave an error of -991 but the first shows 919.

[*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
* SQL RETURN CODE: 919 *
* ERROR OPENING CRS3E00 CSR *
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
* SQL RETURN CODE: 991- *
* ERROR CLOSING CRS3E00 CSR *
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
* SQL RETURN CODE: 991- *
* ERROR CLOSING CRS028 CSR *
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* ][/code]


How do you relate "DECLARE E5100CR CURSOR" to "CRS3E00" in the above message extract?

Since 919 does not exist in DB2, you didn't get a 919 from an SQL statement. This is supported by the SQLSTATE being zero, rather than some value which would aid problem determination.

Did you try Dick Scherrer's suggestion?

If you want anything further here, you're going to have to cough-up relevant unedited code.
Back to top
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Wed Apr 04, 2012 8:17 pm
Reply with quote

Hello All,
We discarded the cursor approach and went with downloading of table data. The reason was this was a one time run requirement and a download was able to cater the need. Also on the cursor name question, I just changed the name of the cursor while posting it in this forum.The program had the same cursor name in the definition and while opening the cursor.

Thanks for all the help and apologies if I created a whole lot of confusion.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 04, 2012 8:24 pm
Reply with quote

Good to hear it is resolved - thank you for letting us know icon_smile.gif

d
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top