MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Field values mysteriously changing

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
dhiraj099
Beginner


Joined: 06 Sep 2004
Posts: 2
Topics: 1

PostPosted: Mon Sep 06, 2004 4:34 am    Post subject: Field values mysteriously changing Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Sep 06, 2004 7:13 am    Post subject: Reply with quote

Dhiraj,

Can you post the move statement and the fields associated with it?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dhiraj099
Beginner


Joined: 06 Sep 2004
Posts: 2
Topics: 1

PostPosted: Mon Sep 06, 2004 8:01 am    Post subject: Reply with quote

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
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Mon Sep 06, 2004 8:31 am    Post subject: Reply with quote

You need to post your definitions, sounds like the one field is defined as numeric signed.
Back to top
View user's profile Send private message Visit poster's website
anjanreddy
Beginner


Joined: 13 Aug 2004
Posts: 3
Topics: 2

PostPosted: Tue Sep 07, 2004 3:50 am    Post subject: Reply with quote

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 Razz
Back to top
View user's profile Send private message
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Wed Sep 08, 2004 6:03 am    Post subject: Reply with quote

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
View user's profile Send private message
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Wed Sep 08, 2004 6:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group