View previous topic :: View next topic |
Author |
Message |
anettis Beginner

Joined: 08 Nov 2004 Posts: 15 Topics: 5
|
Posted: Wed Feb 15, 2006 11:46 am Post subject: COBOL/LE Error Handling of U4038 |
|
|
I have come across a odd handling of divide by zero abends within COBOL/LE. I can easily recreate this same behavior under CICS or batch. Take the following test cases:
Test Case #1 |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12382 Topics: 75 Location: San Jose
|
Posted: Wed Feb 15, 2006 12:41 pm Post subject: |
|
|
anettis,
why not use ON SIZE ERROR clause and handle the abend by your self?
ex:
Code: |
COMPUTE RESULT ROUNDED = A * B / C
ON SIZE ERROR
MOVE ZERO TO RESULT
DISPLAY 'SUCCESSFULLY MOVED ZERO TO RESULT'
END-COMPUTE.
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
anettis Beginner

Joined: 08 Nov 2004 Posts: 15 Topics: 5
|
Posted: Wed Feb 15, 2006 12:53 pm Post subject: |
|
|
Hi Kolusu. I realize that ON SIZE ERROR would prvent the condition all together. The system that I am working with is very old and has plenty of COMPUTE statements without ON SIZE ERROR - so updating them all in short order would not be possible. My real concern at this point is why LE and COBOL would handle what is essentially the same COMPUTE statement in two drastically different ways - to me this indicates a weakness or bug with either LE or COBOL. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12382 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
anettis Beginner

Joined: 08 Nov 2004 Posts: 15 Topics: 5
|
Posted: Wed Feb 15, 2006 2:11 pm Post subject: |
|
|
Kolusu,
Very nice find - that is indeed similar to what I am seeing.
Thanks,
Tony |
|
Back to top |
|
 |
|
|