View previous topic :: View next topic |
Author |
Message |
dhiraj099 Beginner
Joined: 06 Sep 2004 Posts: 2 Topics: 1
|
Posted: Mon Sep 06, 2004 4:34 am Post subject: Field values mysteriously changing |
|
|
It's a cobol-vsam program. Due to change in the copybook in our
re-engineered application, we decided to write a "conversion program"
to translate the copybook of other interfacing applications, within the same environment, into the format of our copybook and re-translate them into the original copybook on the return.
Both the copybooks (Our application and external application) are of the
same length. During translation we do "Move Field1 to Field2", quite
mysteriously the value of last byte of Field2 is not the same as of Field1. Even when we override this with correct value when it's moved to another field once again the last byte is not the same in the receiving field. And it goes on, i.e. every field it touches gets infected and screws the value of the last byte of the target field.
It works fine though with original application (Non-reengineerd one), it
just gets screwed up in translation program during the "Move"
statement. It tried all sortsa fix but didn't work. This is a live project for a major client and we're hopelessly stuck here. Any meeningful help will be sincerely appreciated. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Sep 06, 2004 7:13 am Post subject: |
|
|
Dhiraj,
Can you post the move statement and the fields associated with it?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
dhiraj099 Beginner
Joined: 06 Sep 2004 Posts: 2 Topics: 1
|
Posted: Mon Sep 06, 2004 8:01 am Post subject: |
|
|
MOVE ORD-FBSI-ORD-NUMBER TO CF-ORD-FBSI-ORD-NUMBER. So if ORD- field has a value of "04250BBBBR", at the end of the Move the values stored in CF-ORD is something like "04250BBBB7". The last byte always gets screwed up. I also checked other fields in the vicinity to make sure no overlapping of values from nearby fields. Also no redefinitions occurs here.
When I checked the "Hex" values of these, it's very interesting, for instance the last byte in the Hex strings is always, for instance, D7 in ORD- field but the same is changed to F7 in the CF-ORD- field. |
|
Back to top |
|
|
warp5 Intermediate
Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Mon Sep 06, 2004 8:31 am Post subject: |
|
|
You need to post your definitions, sounds like the one field is defined as numeric signed. |
|
Back to top |
|
|
anjanreddy Beginner
Joined: 13 Aug 2004 Posts: 3 Topics: 2
|
Posted: Tue Sep 07, 2004 3:50 am Post subject: |
|
|
u need to give the two declarations as well the move stmt. then we can try. becoz i am not gettting where exactly the problem is |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Wed Sep 08, 2004 6:03 am Post subject: |
|
|
As warp5 says, you must surely have it defined as a numeric field and the move is treating the last byte as if it had a sign in it. COBOL MOVE may do sign manipulation depending on the compiler options.
Although these fields are misleadingly called xxxxxxxORD-NUMBER they are clearly not numbers and both the sending and recieving fields should be PIC X(nn). |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Wed Sep 08, 2004 6:07 am Post subject: |
|
|
Quote: |
COBOL MOVE may do sign manipulation depending on the compiler options.
|
Just to expand this:
COBOL MOVE may do sign manipulation depending on the compiler options, the exact definitions of the fields involved and the version of the COBOL compiler. |
|
Back to top |
|
|
|
|