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 

Abend code & return code

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


Joined: 26 Apr 2006
Posts: 16
Topics: 8
Location: Utopia

PostPosted: Fri Aug 31, 2007 4:18 am    Post subject: Abend code & return code Reply with quote

I have a few basic questions -

1. What is the need to abend a program? The same (program stop) functionaliy can be achieved via a 'stop run' and a appropriate 'return-code' (to indicate an error). So, what's the use of abending any program. Is there any use other than getting memory dumps ?

2. how is an abend code different from a return code ?

Any answers or pointers to answers will be of great help.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Aug 31, 2007 4:40 am    Post subject: Reply with quote

cxvxbx,

An abend (abnormal & end put together) is an abnormal, rather than planned, unexpected,end or termination of a computer program because of some problem with how it is running. For example, the program may have attempted to address some computer memory space that it was not given the right to address.

An abend usually refers to the abnormal end of an application program because of application errors. A simple abend is divide by zero. We can handle this abend in the code itself and if the code does not handle, you will end up with an abend.


The RETURN-CODE special register can be used to pass a return code to the calling program or operating system when the current COBOL/PLI program ends. When a program ends:

If control returns to the operating system, the value of the RETURN-CODE special register is passed to the operating system as a user return code. The supported user return code values are determined by the operating system, and might not include the full range of RETURN-CODE special register values.
If control returns to a calling program, the value of the RETURN-CODE special register is passed to the calling program. If the calling program is a COBOL program, the RETURN-CODE special register in the calling program is set to the value of the RETURN-CODE special register in the called program.

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


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Fri Aug 31, 2007 9:14 am    Post subject: Reply with quote

Just to expand a little on Kolusu's explanation. You can achieve the same results by issuing a user abend or issuing a stop run with a return code. However the user abend will terminate the job unless you have conditional statements to run certain steps in the event of an abend. You'd need to put conditional statements into your JCL to flush remaining steps based on a return code.
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