error and abend



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

Re: error and abend

Postby steve-myers » Tue Mar 15, 2011 10:18 am

Quasar wrote:When a Program completes successfully, it sets a Return Code or COND CODE=00, to mark-off its successful completion. On the other hand, when the COBOL Program detects an error, it sets a non-zero (bad) Return-Code or COND CODE, to raise an alarm, a warning-signal, and complains.

At times, a Program attempts to execute an instruction at the machine code level, which is logically impossible. The MVS OS has to abnormally terminate or kill the program. This program crash is called an Abend. Every Abend leaves behind a System Abend-Code Sxxxx-yyy.

The second paragraph is mostly wrong. It starts well in the first sentence, but there are hundreds of additional system ABENDs that have nothing to do with an invalid instruction or data that is invalid for the instruction. Most system ABENDs encountered by most programmers are related to problems when a program attempts to open a dataset, and a problem of some sort is encountered.

The term "ABEND" is the name of the Assembler macro that often initiates the termination. All system ABEND codes are three hexadecimal digits, often followed by a reason code that is sometimes decimal digits, and sometimes hexadecimal digits: S213-04, as an example when a program attempts to open a dataset that is not actually there.

The second and third hexadecimal digits of a system ABEND code are often the SVC used when the error is detected. S80A, for example, is often encountered when the system is attempting to execute an SVC X'0A' instruction. S213 when SVC X'13' is executing. This is not always true. S0Cx ABENDs are generally caused by program checks, either an invalid instruction or invalid data for an instruction.

The first paragraph also has problems. The term COND CODE, as used in

IEF142I XXXXXXJ EXECSUM A - STEP WAS EXECUTED - COND CODE 0000

is just another, probably poorly chosen, term for return code. All programs, not just Cobol programs, started by the JCL EXEC PGM=xxx statement end with a return code which is faithfully reported in the IEF142I message, even if the return code is garbage.
steve-myers
Global moderator
 
Posts: 1886
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Re: error and abend

 

Re: error and abend

Postby Quasar » Tue Mar 15, 2011 10:51 am

Steve -
steve-myers wrote:The second paragraph is mostly wrong. It starts well in the first sentence, but there are hundreds of additional system ABENDs that
have nothing to do with an invalid instruction or data that is invalid for the instruction. Most system ABENDs encountered by most programmers are related to problems when a program attempts to open a dataset, and a problem of some sort is encountered.


I do understand, that not every System Abend has to with data or instruction. Yes, space issues, DFSORT issues, contention issues and many more could cause a crash or an ABEND.

Dick -

No this is not OK. Any return-code (even zero) can signify complete success, qualified success, or that something has failed.


I do understand, that it is completely upto the programmer who writes the program, to determine what constitutes good Return Codes, and what are the bad ones.

Very politely Dick, my website caters to a cosmopolitan audience, a large percentage of which, are beginners. Hence, while posting any topic on my website, I'd stick to the "Vital Few factors, while leaving out the trivial many". As a kid, when you learnt Physics, you knew that a feather and an iron, dropped from a height would fall with the same acceleration. But, you'd ignore the friction caused by air. Its something like that.

Attempting to explain "that even a 00 COND CODE could even mean a failure", to a graduate, who's just passed out of college, who's never worked on a Mainframe System, could only complicate matters. Now, bearing in mind that, "IBM Software Programs follow the convention that a Return Code=00 means a success, and non-zero one implies a failure", I posted those lines. Of course, I didn't intend to generalize.

While there is a plethora of Documentation available, on the internet, you surely don't expect beginners to read the Principle of Operations Pooh.!

Also, while talking about abends, I intended to confine the discussion to only System Abends, and not discuss User Abends.

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 NicC » Tue Mar 15, 2011 12:24 pm

One of the first things we were encouraged to do WAS to read Principles of Operation! I'm still doing it - haven't gone past chapter 3 yet.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: error and abend

Postby dick scherrer » Wed Mar 16, 2011 12:06 am

Hello,

Very politely Dick, my website caters to a cosmopolitan audience, a large percentage of which, are beginners. Hence, while posting any topic on my website, I'd stick to the "Vital Few factors, while leaving out the trivial many".
Then i believe this is doing the audience a dis-service. Until you have had the time to learn many, many more things in depth, i suspect that the "Vital Few factors" will not be known and posted among that data.

Worse, if you happen to say things that are easily read and followed, people will have no idea that what they are reading is at best only incomplete. How can they know if you have not yet learned this. . .

For What It's Worth - i've been in IT for quite a while and know a few things rather deeply and would never try to post a website that says "Here's How It Is Done". . . I believe these postings/publications are better left to those more qualified than i am.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: error and abend

Postby Quasar » Wed Mar 16, 2011 9:48 am

Thanks dick, steve and bill. That sure is an eye-opener.

I shall bear that in mind, and as you said I shall strive to learning more and more.

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 » Fri Mar 18, 2011 6:43 am

Principles of Operation is, and always has been, very hard reading, especially for people whose first language is not English.

Rather than reading the whole thing, which I do not think any sane person has ever done, I would concentrate on Chapter 2 through either General Registers or perhaps Floating-point Registers and skipping Expanded Storage (I don't think any z/Architecture machine actually has expanded storage, any way) , the first part of Program Execution, and then selected instructions in the General Instructions and Decimal instructions section.
steve-myers
Global moderator
 
Posts: 1886
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: error and abend

Postby ramarao.d » Wed Mar 23, 2011 12:19 pm

error - at the time of compilation (failure of compilation) syntax missing like.
abend- program terminated at middle of the execution.
ramarao.d
 
Posts: 1
Joined: Wed Mar 23, 2011 11:00 am
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post