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 SQLCODE = -310 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: Thu May 13, 2010 6:49 pm    Post subject: Getting SQLCODE = -310 while opening cursor.
Reply with quote

Hi,
A group variable is having mulitple elements
Following are my two elementary variable:
FCCs-abc PIC S9(5) COMP-3 VALUE +0
Fcc1-abc10 PIC S9(6) COMP-3 VALUE +0

this two variable make the ID, key for my table - Passtable
the table defination for above field is:
IDNUM PIC S9(12)V USAGE COMP-3.

I am using cursor defined as:
DECLARE ABCNUM CURSOR FOR
SELECT DISTINCT(A.IDNUM)
FROM PAsstable a, passtable b
WHERE A.xnum =B.xnum
AND A.IDNUM = :IDNUM
AND A.IDNUM <> B.IDNUM
END-EXEC.

I am getting SQLCODE = -310 while opening cursor. Is my movement of data proper.
Or how should i proceed to avoid any issues while opeining and fetching the data.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu May 13, 2010 7:22 pm    Post subject:
Reply with quote

well the -310 indicates that your host variable IDNUM is not properly populated.

how do you populate IDNUM with FCCs-abc and Fcc1-abc10?

[sarcasm on]
with a redefine???
[sarcasm off]

would suggest something along the lines of
COMPUTE IDNUM = Fcc1-abc10 + (FCCs-abc * 1000000) end-compute
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu May 13, 2010 7:28 pm    Post subject:
Reply with quote

How are you getting from FCCs-abc and Fcc1-abc10 to IDNUM?

Well Dick you type faster then me. With no concept of data formats concatenating FCCs-abc and Fcc1-abc10 would be the natural (but wrong way to do it)!
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: Fri May 14, 2010 5:10 am    Post subject:
Reply with quote

Hello,

In addition to problems with the "group", you may also have problems with the sign(s).

Suggest this be re-implemented properly to prevent all sorts of adventures later. . .
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Fri May 14, 2010 10:43 am    Post subject:
Reply with quote

Hi,
FCCs-abc PIC S9(5) COMP-3 VALUE +0
Fcc1-abc10 PIC S9(6) COMP-3 VALUE +0

above variable are defined as in include of the input file.
Combination of above tow makes a account number.

Passtable has vraibale with below defination
IDNUM PIC S9(12)V USAGE COMP-3.

I want to combine above two file variable in cobol-db3 code to get IDNUM which will help me to access passtable .

Kindly provide your suggestions
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Fri May 14, 2010 3:27 pm    Post subject:
Reply with quote

Dick has already posted a suggestion:
Quote:

would suggest something along the lines of
Code:
 
COMPUTE IDNUM = Fcc1-abc10 + (FCCs-abc * 1000000) end-compute

Does that not satisfy your need?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Sat May 15, 2010 7:54 pm    Post subject:
Reply with quote

Craq Giegerich wrote:
How are you getting from FCCs-abc and Fcc1-abc10 to IDNUM?

Krunal,
Answer of this first....
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Mon May 17, 2010 10:38 am    Post subject:
Reply with quote

HI craq,
I did not get your question.

IDNUM is a combination of :

IDNUM is 12 digit,
FIrst six digit are from Fcc1-abc10 and next six digit from FCCs-abc
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 Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 am
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am


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