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
 

 

Error in Cursor: ILLEGAL SYMBOL

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

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Thu Nov 06, 2008 10:54 am    Post subject: Error in Cursor: ILLEGAL SYMBOL
Reply with quote

Hi,

I am facing a problem in my project.

I have declared a following CURSOR in my cobol-DB2 program.

Code:
EXEC SQL
      DECLARE craccur CURSOR FOR
      SELECT cracket_code, item_name, shop_code
      FROM cracker
      WHERE stock <= repurchase_level
END-EXEC.

I have declared the cursor in Working storage section.

“EXEC SQL” starts in the column no 12.

“DECLARE craccur” starts in the column no 16.

I am getting the couple of following error, when I precompile the program:

CURSOR 'CURSOR' WAS NOT DECLARED

ILLEGAL SYMBOL "CRACCUR". SOME SYMBOLS THAT MIGHT BE LEGAL ARE:

<END-OF-STATEMENT>

Let me know where I am wrong.

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

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Nov 06, 2008 11:14 am    Post subject:
Reply with quote

Please paste the exact DECLARE CURSOR statement instead of keying it, and use BBCode.
Back to top
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Thu Nov 06, 2008 11:45 am    Post subject:
Reply with quote

Hi Terry,

I don't know what is BBCode.

That's why I have mentioned the column position in my post
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Nov 06, 2008 12:07 pm    Post subject:
Reply with quote

Hello,

Your sql has been "Code"ed. This is how you should post code, jcl, data, etc - anything that needs alignment preserved. There is also Preview which allows you to see your post as it will appear to the forum (rather than how it appears in the reply editor). When you are satisfied with the appearance of your post, Submit. The "Code" tag is near the top of the Reply panel.

What is the sequence of the EXEC SQL statements in your code.

When the errors were presented, what were the message ids?
Back to top
View user's profile Send private message
birdy K

New User


Joined: 05 Mar 2008
Posts: 72
Location: chennai

PostPosted: Thu Nov 06, 2008 12:18 pm    Post subject:
Reply with quote

hi,

May be the cursor name is wrong . Declared one is different from opening. Else check the statement no it gives in error message.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Nov 06, 2008 1:17 pm    Post subject:
Reply with quote

would have been nice to know what page/ln were referenced with the error message.

if lowercase is allowed for imbedded sql,
(don't know, never use lower case, no desire to test)
then I imagine the OPEN cursor statement was generating the errror because the DECLARE cursor statement was not physically first in the program (before the OPEN).
Back to top
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Wed Nov 12, 2008 3:10 pm    Post subject:
Reply with quote

Hi All,

Thanks for your reply.

above error casued, due to compiler settings in my shop, I have confirmed with my system admin.

Once again thanks for your time.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Nov 12, 2008 6:48 pm    Post subject:
Reply with quote

Care to share the details on your solution for the benefit of others?
Back to top
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Thu Nov 13, 2008 7:49 pm    Post subject:
Reply with quote

Hi Terry,

I have already spoke with Sys admin, he said that ' this was realted to system side'
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 DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 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
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am


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