As we all know, when we compile a cobol source, if only infomations exist, the return code will be 0; if warnings exist, the return code will be 4; if server error exist, the return code will be larger than 4.
But, today, when i compile a cobol source, it only reported 34 infomations, and the return code is 4, so i feel fuzzy.
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
The COBOL Programming Guide, from the manuals link at the top of the page, says in section 2.1.7.4:
Quote:
Table 40. Severity codes for compiler error messages
Level of
message Return code
Purpose
Informational (I)
0 To inform you. No action is required and the program runs correctly.
Warning (W)
4 To indicate a possible error. The program probably runs correctly as written.
Error (E)
8 To indicate a condition that is definitely an error.
The compiler attempted to correct the error, but the
results of program execution might not be what you
expect. You should correct the error.
Severe (S)
12 To indicate a condition that is a serious error. The
compiler was unable to correct the error. The program
does not run correctly, and execution should not be
attempted. Object code might not be created.
Unrecoverable (U)
16 To indicate an error condition of such magnitude that
the compilation was terminated.
So if you have a 4 return code, you have at least one warning message.
The COBOL Programming Guide, from the manuals link at the top of the page, says in section 2.1.7.4:
Quote:
Table 40. Severity codes for compiler error messages
Level of
message Return code
Purpose
Informational (I)
0 To inform you. No action is required and the program runs correctly.
Warning (W)
4 To indicate a possible error. The program probably runs correctly as written.
Error (E)
8 To indicate a condition that is definitely an error.
The compiler attempted to correct the error, but the
results of program execution might not be what you
expect. You should correct the error.
Severe (S)
12 To indicate a condition that is a serious error. The
compiler was unable to correct the error. The program
does not run correctly, and execution should not be
attempted. Object code might not be created.
Unrecoverable (U)
16 To indicate an error condition of such magnitude that
the compilation was terminated.
So if you have a 4 return code, you have at least one warning message.
LINEID MESSAGE CODE MESSAGE TEXT
IGYSC0185-I MESSAGES WERE ISSUED DURING LIBRARY PHASE PROCESSING. REFER TO THE BEGINNING OF THE LISTING.
17081 IGYDS1158-I A NON-LEVEL-88 "VALUE" CLAUSE WAS FOUND IN THE "FILE SECTION" OR "LINKAGE SECTION". THE "VALUE" CLAUSE WAS
TREATED AS COMMENTS.
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
Quote:
END OF COMPILATION 1, PROGRAM GXXXXXXX, HIGHEST SEVERITY 0.
Zero means zero. Nothing but informational messages during the compile.
The return code 4 is probably from
Quote:
IGYSC0185-I MESSAGES WERE ISSUED DURING LIBRARY PHASE PROCESSING. REFER TO THE BEGINNING OF THE LISTING.
If a copy book wasn't found, that could be a warning. If you don't look at the message, read the messages, and go to the location(s) specified to find the additional messages, why would you think you understand the compiler output? Copy book processing is a separate phase done before the compile so it is not considered part of the compile from the messages severity code standpoint.
END OF COMPILATION 1, PROGRAM GXXXXXXX, HIGHEST SEVERITY 0.
Zero means zero. Nothing but informational messages during the compile.
The return code 4 is probably from
Quote:
IGYSC0185-I MESSAGES WERE ISSUED DURING LIBRARY PHASE PROCESSING. REFER TO THE BEGINNING OF THE LISTING.
If a copy book wasn't found, that could be a warning. If you don't look at the message, read the messages, and go to the location(s) specified to find the additional messages, why would you think you understand the compiler output? Copy book processing is a separate phase done before the compile so it is not considered part of the compile from the messages severity code standpoint.
Thank you very much!
I found these infos:
LINEID MESSAGE CODE LIBRARY PHASE MESSAGE TEXT
IGYLI0090-W 981 SEQUENCE ERRORS WERE FOUND IN THIS PROGRAM.
MESSAGES TOTAL INFORMATIONAL WARNING ERROR SEVERE TERMINATING
PRINTED: 1 1
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
The -W is why you got the return code 04. So that mystery is now cleared up. The specific message is very clear -- you have the SEQUENCE option set in your compile and you have 981 sequence errors where the line number of the current statement is not greater than the line number of the previous statement. From the COBOL Programming Guide manual (link at the top of the page):
Quote:
2.4.45 SEQUENCE
When you use SEQUENCE, the compiler examines columns 1 through 6 to check that the source statements are arranged in ascending order according to their EBCDIC collating sequence. The compiler issues a diagnostic message if any statements are not in ascending order.
Source statements with blanks in columns 1 through 6 do not participate in this sequence check and do not result in messages.
Note that this section also states that if you use SEQUENCE, you need to coordinate line numbers between the copy books and your source code to prevent sequence errors.