View previous topic :: View next topic
|
Author |
Message |
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Hi all,
i am currently working with a COBOL-DB2 program and i am getting the SQLCODE -310. I know why i was getting -310 but the reason for invalid value is now know. Below is what i was doing.
I FTP a csv(comma delimited file) file int the mainframe and it looks like below
Code: |
1,1,1,5881,42250,0,1,ITEM NOT FOUND ON DATABASE
|
In my cobol program i used the UNSTRING to get the above values delimited by comma.
Code: |
WS-1 PIC 9(07).
WS-2 PIC 9(09).
WS-3 PIC 9(05).
WS-4 PIC 9(09).
WS-5 PIC 9(13).
WS-6 PIC 9(04).
WS-7 PIC 9(09).
WS-8 PIC X(30).
UNSTRING WS-IN
DELIMITED BY ","
INTO ......
|
Then the above file i am moving into the host variables
Code: |
DB2WF-1 PIC S9(7)V USAGE COMP-3.
DB2WF-2 PIC S9(9) USAGE COMP.
DB2WF-3 PIC S9(5)V USAGE COMP-3.
DB2WF-4 PIC S9(9) USAGE COMP.
DB2WF-5 PIC S9(13)V USAGE COMP-3.
DB2WF-6 PIC S9(4) USAGE COMP.
DB2WF-7 PIC S9(9) USAGE COMP.
DB2WF-8 PIC X(30).
|
when i moved the first varibales into the host variables (in same order)...the moved in the host variables are different.
LIKE
like..
Code: |
WS-1 9(7) DISP 0000001
WS-2 9(9) DISP 000000001
WS-3 9(5) DISP 00001
WS-4 9(9) DISP 000005881
WS-5 9(13) DISP 0000000042250
WS-6 9999 DISP 0000
WS-7 9(9) DISP 000000001
WS-8 X(30) DISP 'ITEM NOT FOUND ON DATABASE '
but when i moved the above variables into the host variabels (corresponding) it contained
DB2WF-1 S9(7) CMP3 0000
DB2WF-2 S9(9) COMP -0252644880
DB2WF-3 S9(5) CMP3 000
DB2WF-4 S9(9) COMP -0235867920
DB2WF-5 S9(13) CMP3 0000042
DB2WF-6 S9999 COMP -03339
DB2WF-7 S9(9) COMP -0252645136
DB2WF-ITEM-DESC X(30) DISP 'M NOT FOUND ON DATABASE
|
because of this i am getting -310. but why this is happening is a question. Please help with issue.
thanks, |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
What are your two structures and what does the MOVE CORRESPONDING statement look like?
you have not provided anything in the way of reference names that would qualify for a move corresponding statement. |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
it is just
Code: |
MOVE ws-1 to db2wf-1
.
.
.
.
|
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Arvind,
you program is doing something.
if the ws- variables contained the values you displayed
and
if you moved them as indicated, you would not have the results that you have displayed.
you have neglected to cut&paste the structure definitions, with level numbers.
there could be something with the structure definitions that is causing the problem, but we can not see or know.
have you run the program thru a debugger and displayed the source fields prior to the move and the destination after the move? |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Hi Dick,
i found out the problem. it was my mistake in the program. Thank you for your time.
Thanks, |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Arvind,
glad you were able to solve it.
til next time |
|
Back to top |
|
|
|