Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sign trailing separate 3

Status
Not open for further replies.

LenaS

Technical User
Nov 28, 2000
98
US
As input to my program I have an ascii table file with an amount S9(9)v99 defined as sign trailing separate. If a record meets certain criteria, a sign reversal is necessary. I am doing this by multiplying the amount by -1. This causes an amount value of 1000000- to become
-00010000013. Amounts not requiring this action move thru the program fine, no problem. Debug shows me that as soon as the compute or multiply(I tried both) happens, it messes up my amount. I am obviously not a COBOL programmer. I inherited this code and it is just one application(I plan to rewrite it in the future). Maybe I should just write a simple program to read the file in via sign trailing separate and output it to something COBOL likes better. I am using CA-Realia COBOL on a PC. Please help. Thanks.
 
What would be really grand is a small example of the offending program. What we don't know yet is the exact declaration of the data items involved. Are they perhaps COMP-5 with sign trailing separate, or some other strange construct that exhibits this bug?
 
The EVALUATE code works great. Simply looking at the SIGN and changing IT was not something I had thought of.

Thanks to everybody for your flood of assistance. I'll deal with Realia on why I couldn't do this with an arithmetic operation.
 
Hi Lena,

Thanx for getting back to us and letting us know how you worked it out. It's always good for us to know what works and what doesn't.

Regards, Jack.
 
LenaS...
Thanks for the feedback on the EVALUATE code... Since it works that indicates the input field is correct... Good Luck and let us know what happens as you continue to pursue the problem with Realia... Saginaw
helpdesk@simotime.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top