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

Getting SQLCODE = -310 while opening cursor.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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

Moderator Emeritus


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

PostPosted: Fri May 14, 2010 5:10 am
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts DB2 for z/OS and LUW Admin Job Opening Mainframe Jobs 0
No new posts Looking For a PDS Member Without Open... PL/I & Assembler 10
No new posts Vision PLUS Mainframe opening Mainframe Jobs 0
No new posts Urgent MF opening for TCS India Mainframe Jobs 0
No new posts SQLCODE = -122 while using the scalar... DB2 4
Search our Forums:

Back to Top