Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

question about return code of cobol compilation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
penk

New User


Joined: 02 Apr 2009
Posts: 5
Location: China

PostPosted: Tue Nov 17, 2009 3:42 pm    Post subject: question about return code of cobol compilation
Reply with quote

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.

Is there anyone can tell me that's why?
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 17, 2009 3:48 pm    Post subject: Re: question about return code of cobol compilation
Reply with quote

penk wrote:
But, today, when i compile a cobol source, it only reported 34 infomations, and the return code is 4, so i feel fuzzy.

Mmmmmmmmmmmmmmm, what did Fuzzy have to say about that icon_lol.gif
Back to top
View user's profile Send private message
penk

New User


Joined: 02 Apr 2009
Posts: 5
Location: China

PostPosted: Tue Nov 17, 2009 3:52 pm    Post subject: Re: question about return code of cobol compilation
Reply with quote

expat wrote:
penk wrote:
But, today, when i compile a cobol source, it only reported 34 infomations, and the return code is 4, so i feel fuzzy.

Mmmmmmmmmmmmmmm, what did Fuzzy have to say about that icon_lol.gif



when we compile a cobol source, if there is only infomations exist, the return code also will be 4 ?

But, i also tried another cobol source, it compilation reported only one information, and the return code is 0.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 17, 2009 4:33 pm    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
penk

New User


Joined: 02 Apr 2009
Posts: 5
Location: China

PostPosted: Tue Nov 17, 2009 4:40 pm    Post subject:
Reply with quote

Robert Sample wrote:
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.

SAME MESSAGE ON LINE: 17258 17365 17544 17592 18580 18614 18675 18736 18801 18856 18927 19007
19078 19158 19202 19238 19251 19320 19382 19437 19453 19514 19600 19622
19652 19713 19726 19772 19831 19870

19148 IGYDS1073-I "FRM-REDEF-1" REDEFINED A LARGER ITEM.

19372 IGYDS1073-I "FRM-REDEF" REDEFINED A LARGER ITEM.
MESSAGES TOTAL INFORMATIONAL WARNING ERROR SEVERE TERMINATING
PRINTED: 34 34
* STATISTICS FOR COBOL PROGRAM GXXXXXXX:
* SOURCE RECORDS = 21718
* DATA DIVISION STATEMENTS = 8333
* PROCEDURE DIVISION STATEMENTS = 866
END OF COMPILATION 1, PROGRAM GXXXXXXX, HIGHEST SEVERITY 0.
RETURN CODE 4
Back to top
View user's profile Send private message
penk

New User


Joined: 02 Apr 2009
Posts: 5
Location: China

PostPosted: Tue Nov 17, 2009 4:44 pm    Post subject:
Reply with quote

Now, I put the compile info on, as you can see, there is only 34 informations, but the return code is 4.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 17, 2009 4:48 pm    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
penk

New User


Joined: 02 Apr 2009
Posts: 5
Location: China

PostPosted: Tue Nov 17, 2009 5:01 pm    Post subject:
Reply with quote

Robert Sample wrote:
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.




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


Can you tell me why?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 17, 2009 5:13 pm    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us