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 

COBOL/LE Error Handling of U4038

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


Joined: 08 Nov 2004
Posts: 15
Topics: 5

PostPosted: Wed Feb 15, 2006 11:46 am    Post subject: COBOL/LE Error Handling of U4038 Reply with quote

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


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

PostPosted: Wed Feb 15, 2006 12:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
anettis
Beginner


Joined: 08 Nov 2004
Posts: 15
Topics: 5

PostPosted: Wed Feb 15, 2006 12:53 pm    Post subject: Reply with quote

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


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

PostPosted: Wed Feb 15, 2006 1:09 pm    Post subject: Reply with quote

anettis,

Take a look at this PTF which discusses a similar issue

http://www-1.ibm.com/support/docview.wss?uid=isg1PQ62071

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


Joined: 08 Nov 2004
Posts: 15
Topics: 5

PostPosted: Wed Feb 15, 2006 2:11 pm    Post subject: Reply with quote

Kolusu,

Very nice find - that is indeed similar to what I am seeing.

Thanks,

Tony
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