Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getting -504 Cursor Name GTT-ARTS-CURSOR is not Declared

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

New User


Joined: 14 Dec 2015
Posts: 10
Location: United States

PostPosted: Fri Mar 17, 2017 1:43 am    Post subject: Getting -504 Cursor Name GTT-ARTS-CURSOR is not Declared
Reply with quote

I have a COBOL program (RSJUNK) that is calling a Stored Procedure (SPJUNK). The Stored Procedure is building my GTT and when I am done I open a cursor that is defined "WITH RETURN TO CALLER" as part of the DECLARE.

When I return to RSJUNK, I look to see if it found data or not based on the content of my "output" parm of my stored procedure. When I have data I am doing the "ASSOCIATE LOCATORS (:L0C) WITH PROCEDURE SPJUNK " and the "ALLOCATE GTT CURSOR FOR RESULT SET :LOC".

When I then try to fetch this cursor, I am getting a -504 Cursor name is not declared. Could someone please shed some light on what I am missing?

Thanks for any help you can provide.
Back to top
View user's profile Send private message

Robin Sulsona

New User


Joined: 14 Dec 2015
Posts: 10
Location: United States

PostPosted: Sat Mar 18, 2017 12:50 am    Post subject: Reply to: Getting -504 Cursor Name GTT-ARTS-CURSOR is not Declared
Reply with quote

I have found my problem. Stored Procedures are new for me so I didn't know that I needed to do the Create Procedure with a RESULT SET 1. I copied my create from the other Stored Procedure and it was RESULT SET 0. I found another person in our dept. that had done this and he gave me 2 sample programs to look at. My code was good but I decided to look at the create procedure DDL and found that he had a value other than 0.

Now everything is working like I need it to for unit testing.

Hope that this may help someone else in the future. icon_biggrin.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Mon Mar 20, 2017 8:11 pm    Post subject:
Reply with quote

Yes, it will . Thanks
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 Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts DB2 Stored Procedure - Dynamic SQL - ... GuyC DB2 2 Wed Feb 17, 2016 5:10 pm
No new posts ISREDIT - Position Cursor on the Comm... Tarique Anwer TSO/ISPF 5 Wed Feb 03, 2016 12:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us