error and abend



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

error and abend

Postby electrox » Sun Mar 06, 2011 1:17 pm

WHAT IS THE DIFFERENCE BETWEEN ERROR AND ABEND?
electrox
 
Posts: 6
Joined: Tue Feb 15, 2011 8:24 am
Has thanked: 0 time
Been thanked: 0 time

Re: error and abend

Postby BillyBoyo » Sun Mar 06, 2011 2:52 pm

Firstly, it is considered not the done thing to type with all capital letters, unless you really want to indicate that you are "shouting".

Secondly, this isn't a Cobol-specific question, so next time look for the most appropriate forum to ask the question in.

Thirdly, it really is a very basic question. Did you do anything youself to try to answer it? I can assume you know what an "error" is, so why not google "what is an abend"? I assume you also have some work colleagues, or training colleagues or a teacher? Have you exhausted all such possibilities first? (in which case you can tell us, so we know, but I don't think so).
If you still have problems afterwards, ask and explain please.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: error and abend

Postby electrox » Mon Mar 07, 2011 7:26 am

Sorry ... Actually i tried but not exhausted.. Anyways i lll try.. Thanks for this kind reply..
electrox
 
Posts: 6
Joined: Tue Feb 15, 2011 8:24 am
Has thanked: 0 time
Been thanked: 0 time

Re: error and abend

Postby dick scherrer » Mon Mar 07, 2011 10:25 am

Hello,

What are have you "tried"? What kind of difference are you looking for? What prompted the question?

The people who encourage the use of proper termnology use "abend" to mean a System (Sxxx) or a User (Unnnn) abend (which causes the 3rd positional parameter of DISP to be used).

Unfortunately, lots of really bad instructors these days and even some ill-trained people of little experience call many other things an abend :(

Usually a System abend is the result of some error - Either in the code, the data, or the jcl and/or control statements. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: error and abend

Postby electrox » Tue Mar 08, 2011 8:02 am

Error occurs before execution of job or step.it is generally due to syntax errors in jcl coding.The error messages will appear in JES messages.

Abend happens during the execution of a program in step. There may some invalid operaration.When Os encounters such an operation, the respective job is terminated with the Abend code.

Is This Right? :roll:
electrox
 
Posts: 6
Joined: Tue Feb 15, 2011 8:24 am
Has thanked: 0 time
Been thanked: 0 time

Re: error and abend

Postby dick scherrer » Tue Mar 08, 2011 8:30 am

Hello,

Not quite. . .

There are many more errors than jcl syntax errors (which cause a job to never start). . . Errors that do not cause an abend may occur while running the job.

There are also User abends (determined by the developer).
When Os encounters such an operation, the respective job is terminated with the Abend code.
These are System abends.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: error and abend

Postby steve-myers » Tue Mar 08, 2011 8:33 am

No. The first paragraph is not complete. You can get errors throughout the cycle of running a job. An ABEND (abnormal end) is just another way to express an error. Many, though not all, JCL errors are detected before the job actually starts, and nothing in the job executes. Other JCL errors are detected after the job starts, and usually cause the job to fail.

In some ways this is very frustrating, especially for someone used to something like Unix where you do not have ABENDs, and individual programs have to detect and respond to errors. You don't see code like this -

if ( ( f = fopen(... ) ) == NULL )
printf( "I can't open...\n" );
else
{
....
}

in mainline MVS programs, even though many times the MVS equivalent to fopen does not ABEND because the object to open is not defined to the program, and it causes a frequently hard to analyze error later in the program.

Mainline MVS programs can initiate an ABEND directly, though I don't know of any compiled languages, like C or Cobol that define something like this in the language, or they can be ABENDed while performing a system service like opening a data set, or an ABEND can be generated if an instruction does something illegal, like trying to use storage that is not assigned to the program. An ABEND initiated by a program is usually a user ABEND, though it is actually quite easy to issue a fake system ABEND.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: error and abend

Postby BillyBoyo » Thu Mar 10, 2011 4:08 am

An Abend is an error. An error does not necessarily cause an Abend. An error is a mistake, a cock-up, a typo, just the same as an error anywhere else. It's just something wrong.

You get a system Abend when you, directly or indirectly, ask the CPU to do something which is not possible. Like, address a piece of storage which you do not have access to, divide by zero, caluculate with non-numeric data, call a program that doesn't exist, try to execute an op-code that does not exist, etc.

A User Abend is when some software you are using idenfities that you are asking it to do something it can't do, or something that is illogical or contradictory. The software knows it can't continue, so issues a User Abend with a code and a message.

An error is just something you got wrong, just like any sort of error. It could be a JCL error (so you JCL gets thrown out) or it could be a logic/data error in a program that you (or anyone) has written.

Specific causes of erorrs are far to numerous to attempt to mention or categorise. They can be much more subtle and difficult to "solve" than a dump, especially those not discovered for days after they first occured (so you have to end up with file/DB fixes).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: error and abend

Postby Quasar » Sun Mar 13, 2011 11:45 pm

Hello -

Here's my understanding.

The Program is Killed - ABEND
When a Program encounters an exceptional situation(error), which it is unable to handle, the OS has to intervene and KILL the Program. This is called an Abend. When an Abend occurs, the MVS OS is in a hurry to rush to the Abend-Exit door, and flushes out all "the remaining steps" in the Job. Every ABEND has ABEND Code.

The Program terminates peacefully -
When a Program encounters an exception, which it was designed to detect and handle, it comes to an end peacefully, by executing STOP RUN. The Software Program complains about this error(exception) by setting a two-digit status code, called COND CODE or RETURN Code. Programs set different Return-codes, to indicate different things to the Outside-world, and raise an alarm. Such programs are said to be robust.

However, when I began to work with the UCC CA-7 product, the lines between these two are quite hazy. I mean, I used to hear several folks at my shop, treating a Program setting a bad return-code, as an "ABEND", atleast in common parlance(in English).

Thank you very much.
Quasar Chunawala,
Software Engineer, Lives at Borivali, Mumbai
User avatar
Quasar
 
Posts: 102
Joined: Wed Nov 10, 2010 7:11 pm
Location: Borivali, Mumbai
Has thanked: 13 times
Been thanked: 2 times

Re: error and abend

Postby steve-myers » Mon Mar 14, 2011 12:30 am

STOP RUN is a Cobol construct. Other languages have similar, if not identical, constructs. The C language, for example, has 3 possible constructs:
  • The return statement in a"main" function.
  • A "main" function runs out of statements.
  • The exit() library function.
OS/360 Assembler programs are effectively run as a subroutine from the operating system. Like C "main" functions they exit using the RETURN macro. Most beginners do not know this, but when a program called by the operating system, and that includes programs entered by OS services like the LINK macro, the program "returns" to an SVC 3 instruction which completes termination of the program.

Termination of a "main" program that uses a a run time library is usually handled by the library, and it attempts to perform most of the services discussed in the next paragraph.

"Full" termination of an Assembler "main" program by the operating system is actually quite involved, This is also done when a program terminates with an ABEND. The major service performs a CLOSE for any OPEN datasets. This can lead to the dreadded IEC999I message when the DCB or ACB .data area has been deleted or hopelessly damaged. The other major service is to cleanup allocated storage. In systems with complex storage maps like MVS this can be quite involved.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post