View previous topic :: View next topic
|
Author |
Message |
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
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 |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Craq Giegerich wrote: |
How are you getting from FCCs-abc and Fcc1-abc10 to IDNUM?
|
Krunal,
Answer of this first.... |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
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 |
|
|
|