Page 1 of 2

Common cobol errors

PostPosted: Tue Mar 26, 2013 10:34 pm
by pearl
Please could anyone provide me a list of the common errors occurring in COBOL?

Re: common cobol errors

PostPosted: Tue Mar 26, 2013 10:49 pm
by Quasar
Pearl,

Though it's very naïve to ask, what are the most common errors, you'd face when writing a Cobol program, here's a post, that might be of interest to you - External link removed. And moderators, pardon me for referring an external URL.

Also, to generate a complete listing of all possible errors in Cobol, along with the error-codes and their descriptions, write a Cobol program, with the PROGRAM-ID ERRMSG, compile it and look at the listing in the Spool.

        IDENTIFICATION DIVISION.
        PROGRAM-ID. ERRMSG.


Thank you very much.

Re: common cobol errors

PostPosted: Tue Mar 26, 2013 11:00 pm
by enrico-sorichetti
posting links to a <competitor> site is considered everywhere bad manners!

Re: common cobol errors

PostPosted: Tue Mar 26, 2013 11:07 pm
by Robert Sample
You have asked a strange question where the reply will depend upon how the question is interpreted. If you merely want to know the more common COBOL errors while executing a program, they would include S0C4, S0C7, and a few others (depending upon the site and the experience level of its COBOL coders and whether you are talking about batch/online programs and file/database programs and there are other ways to look at this question not yet mentioned), and not all execution-time errors are the coder's fault such as Sx37 space problems. If you want instead to know the more common COBOL errors encountered when compiling a program, that depends entirely upon the individual coder and his/her skill set.

Re: common cobol errors

PostPosted: Wed Mar 27, 2013 12:54 am
by c62ap90
Good question.

The NOT statement will get you into trouble. Even when it looks correct, it may not be doing what you intended. Test it!
IF field NOT EQUAL 'A' OR 'B'
IF field NOT EQUAL ('A' OR 'B')
IF field NOT EQUAL 'A' AND 'B'
IF field NOT EQUAL ('A' AND 'B')
...

Re: common cobol errors

PostPosted: Wed Mar 27, 2013 1:23 am
by dick scherrer
Hello,

Please could anyone provide me a list of the common errors occurring in COBOL?
I have not seen such a list. Depending on the environment, the features/tools used (ie DB2 rather than IMS - or both and Many, Many more), the standards in effect, etc.

Also, errors that are common to coders with little or no experience will most likely not be common to the experienced staff.

There is a considerable between compiler errors and run-time errors.

When you have something more specific to ask, someone should be able to answer.

Re: common cobol errors

PostPosted: Wed Mar 27, 2013 1:59 am
by c62ap90
Not a complete list but a list...
http://www.tek-tips.com/viewthread.cfm?qid=875413

Re: common cobol errors

PostPosted: Wed Mar 27, 2013 2:01 am
by c62ap90
enrico-sorichetti wrote:posting links to a <competitor> site is considered everywhere bad manners!

Who are the competitor sites? Never heard of this before!

Re: common cobol errors

PostPosted: Wed Mar 27, 2013 2:11 am
by dick scherrer
Hello,

Who are the competitor sites?
There are hundreds of these . . . And no, we won't be naming them :)

Some sites will ban a user for posting link(s) to competitor site(s).

Re: common cobol errors

PostPosted: Wed Mar 27, 2013 4:48 am
by c62ap90
enrico-sorichetti wrote:posting links to a <competitor> site is considered everywhere bad manners!

How can it be bad manners if we don't know who the competitors are? Basic logic, you know!