COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665



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

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby Aki88 » Wed May 18, 2016 10:17 pm

This is an exact copy-paste of the manual:


000100 Identification Division.
000200 Program-ID. ErrMsg.
 
Aki88
 
Posts: 303
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 32 times
Been thanked: 27 times

Re: Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

 

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby BillyBoyo » Thu May 19, 2016 12:02 am

      PROGRAM-ID. ERRMSG.


That's the minimum you should need.

If that breaks as well, report it to IBM.

I wouldn't expect to see the internal compiler-problem messages from "assert" listed. They are "whoops, that shouldn't happen" messages, not useful diagnostics for a COBOL program. There is no direct "user resolution" to them, even though there may be work-arounds (if you can identify the code that is causing the problem).

Is it a large program? Did it compile before a change, or are you doing migration?
BillyBoyo
Global moderator
 
Posts: 3776
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 257 times

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby Aki88 » Thu May 19, 2016 12:22 am

Hello Billy,

My first attempt on 5.2 with ERRMSG, was with 'ERRMSG'; post your post I'd copy pasted 'ErrMsg' and the mixed case DIVISION from programming guide; both scenarios yielded same compilation error; this one is currently under migration testing, so I'll get it checked with IBM right away - though the few other 'similar-program-type' compilations that I've tested are compiling normally (other than the one from the original post, which pops same message on both 5.1/5.2).

The error from the original post is from 5.1, the program is couple of ten-thousand lines, with copybooks - this is on a live LPAR, which has been up and running clean for quite a while now; I guess it'd have seen a bunch of system patch upgrades as well.

PS: Code is working normally (compilation + execution) on COBOL 4.2.
Aki88
 
Posts: 303
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 32 times
Been thanked: 27 times

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby BillyBoyo » Thu May 19, 2016 1:31 am

Well, somewhere, that program is doing something "unusual" or something which is made worse (to the point of failure) just through the size in some way.

Which level of OPTimization are you using? If not 0, try with 0.

You could do a "quick inspection" of the 40,000-line program(!) and see if you spot anything that looks odd...

If you fancy some fun, you can try to "binary chop" it to locate the problem.

This may not work if there is too much "interaction" (of some type) causing the problem and you happen to "fix" it by reducing the interaction.

Let's say you have 40,000 lines of procedure code.

You consider one (approximate) half of that code. If you remove all of the code within paragraphs/SECTIONs for that half, but leave those labels, the program should still compile - although you'll get RC=8 - if it can.

If the program compiles, try with the other "half". If that fails now in the same way, then you may be on to something. Chop that half into halves again, in the same way, and recompile to get if either gives a failure.

Continue until both current "halves" of the previous (half of the half of the half...) compile without the issue. You would then have a considerably smaller chunk of code that exhibits the problem.

However, bear in mind that even OPT(0) (which you should use if you attempt this) does some optimisations and, although I've not used V5, I fear that that may include at least some, and perhaps lots or all, "unused code", which will likely defeat the process.

If this is so, X-clude all the PERFORMs when you delete the code. That should get the compiler to think things are happening.

Of course, if the code for the PERFORMs is "jam everything on one line if you can, then overflow to the next", that could well be too much to readily fix-up for the dummy compile.

Are you using any of the new compiler options available with V5? If so, turn those off, use TRUNC(STD) and NUMPROC(PFD).

It can be fun to narrow it down, but at the end of the day IBM will sort it out anyway. I just love looking at things like that :-)
BillyBoyo
Global moderator
 
Posts: 3776
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 257 times

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby Robert Sample » Thu May 19, 2016 2:25 am

Very strange. What I got is
PP 5655-W32 IBM Enterprise COBOL for z/OS  5.1.1                         Date 05/18/2016  Time 15:49:16  
Invocation parameters:                                                                                    
 LIST,NOOFFSET,MAP,ARITH(EXTEND)                                                                          
Options in effect:                                                                                        
 NOADATA                                                                                                  
   ADV                                                                                                    
   AFP(VOLATILE)                                                                                          
   APOST                                                                                                  
   ARCH(6)                                                                                                
   ARITH(EXTEND)                                                                                          
 NOAWO                                                                                                    
 NOBLOCK0                                                                                                
   BUFSIZE(4096)                                                                                          
 NOCICS                                                                                                  
   CODEPAGE(1140)                                                                                        
 NOCOMPILE(S)                                                                                            
 NOCURRENCY                                                                                              
   DATA(31)                                                                                              
   DBCS                                                                                                  
 NODECK                                                                                                  
 NODIAGTRUNC                                                                                              
   DISPSIGN(COMPAT)                                                                          
 NODLL                                                                                      
 NODUMP                                                                                      
 NODYNAM                                                                                    
 NOEXIT                                                                                      
 NOEXPORTALL                                                                                
 NOFASTSRT                                                                                  
   FLAG(I,W)                                                                                
 NOFLAGSTD                                                                                  
   HGPR(PRESERVE)                                                                            
   INTDATE(ANSI)                                                                            
   LANGUAGE(EN)                                                                              
   LINECOUNT(60)                                                                            
   LIST                                                                                      
   MAP(HEX)                                                                                  
   MAXPCF(60000)                                                                            
 NOMDECK                                                                                    
 NONAME                                                                                      
   NSYMBOL(NATIONAL)                                                                        
 NONUMBER                                                                                    
   NUMPROC(NOPFD)                                                                            
   OBJECT                                                                                    
 NOOFFSET                                                                                              
   OPTIMIZE(2)                                                                                          
   OUTDD(SYSOUT)                                                                                        
   PGMNAME(COMPAT)                                                                                      
   RENT                                                                                                
   RMODE(AUTO)                                                                                          
   SEQUENCE                                                                                            
   SIZE(5000000)                                                                                        
   SOURCE                                                                                              
   SPACE(1)                                                                                            
 NOSQL                                                                                                  
   SQLCCSID                                                                                            
 NOSQLIMS                                                                                              
   SSRANGE                                                                                              
 NOSTGOPT                                                                                              
PP 5655-W32 IBM Enterprise COBOL for z/OS  5.1.1                         Date 05/18/2016  Time 15:49:16
 NOTERM                                                                                                
 NOTEST(NODWARF)                                                                                        
 NOTHREAD                                                                                              
   TRUNC(STD)                                                                                          
   VBREF                                                                                                
   VLR(STANDARD)                                                                                        
 NOWORD                                                                                                
   XMLPARSE(XMLSS)                                                                                      
   XREF(SHORT)                                                                                          
   ZONEDATA(MIG)                                                                                        
   ZWB                                                                                                  
PP 5655-W32 IBM Enterprise COBOL for z/OS  5.1.1               ERRMSG    Date 05/18/2016  Time 15:49:16
* Statistics for COBOL program ERRMSG:                                                                  
*    Source records = 2                                                                                
*    Data Division statements = 0                                                                      
*    Procedure Division statements = 0                                                                  
*    Generated COBOL statements = 0                                                                    
*    Program complexity factor = 0                                                                      
End of compilation 1,  program ERRMSG,  no statements flagged.                                          
PP 5655-W32 IBM Enterprise COBOL for z/OS  5.1.1               ERRMSG    Date 05/18/2016  Time 15:49:16
IBM Enterprise COBOL for z/OS compiler messages:                                                        
                                                                                                       
This document contains the compiler messages generated by the IBM Enterprise COBOL for z/OS compiler.  
Run-time messages are not included.                                                                    
The actual format of a message generated during compilation is:                                        
nnnnnn  IGYxxmmmm-l   message-text                                                                      
nnnnnn      : is the number of the source line to which the message refers.                            
IGYxxmmmm-l : is the message header.                                                                    
and 4500+ lines of error messages later the end of the compile with a zero condition code and no ASSERT errors.

I remember we had to add a bunch of SYSUT statements for 5.1 when we upgraded from z/OS 1.12 to 2.1 and COBOL 4.2 to 5.1 -- the PROC goes from SYSUT1 to SYSUT15 now. I'd also check the compile options carefully -- some like ARCH or HGPR could easily impact C++ code, I suspect. I don't recall the precise error that popped up the first time we attempted a COBOL 5.1 compile but I remember we had one and that's why we looked at the PROC. We have all the libraries as PDSE now, especially SIGYCOMP.
Robert Sample
Global moderator
 
Posts: 3160
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 190 times

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby Aki88 » Thu May 19, 2016 11:13 am

Thank you Enrico, Billy, Prino, Robert, for looking this one up.

The 5.2 ERRMSG was indeed because of incorrect ARCH set-up for a specific type of batch-code-module - rest all were set up correctly, and as fate would have it - I used the one which was incorrectly set-up; got this source-mod fixed with correct compiler option, modified to ARCH(11), and ERRMSG now gives a clean run.

Robert, the SYSUT*/SYSMDECK and PDSE changes are in place, the V5 COMPILER doesn't even begin to look at the rest of the chunk if any of this is missing, returns a nasty error if these are not in place :)

Billy, OPT was set at 2, I think I saw NUMPROC set at PFD, but I'll revisit that along with OPT; the 5.1/5.2 machines are being accessed via a secure server which restricts COPY/PASTE functions, hence am unable to share a complete listing (options) dump; though I'll revisit them again, and go at it one at a time.

Thank you.

<Edit: The code from the original post compiles correctly; by this I mean - the syntactical error check runs clean; the point where I believe it is supposed to generate the final load module - is where it is failing. Reason for citing this is that, the listing shows two portions in the SYSPRINT of IGYCRCTL - the first chunk is the regular set of warning/informational messages which end with a return code-4; this is followed by the termination message shared in the original post - this message is the one that Billy and Enrico had pointed at in their posts pertaining to C++ messages from the Fix-List; is there a manual that has all of these messages compiled in one place? >
Aki88
 
Posts: 303
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 32 times
Been thanked: 27 times

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby Robert Sample » Thu May 19, 2016 8:37 pm

Looking at the IBM web site, there seem to be a pretty good number of APARs (as in multiple dozens) for ASSERT problems in COBOL 5.1 and 5.2 -- I didn't see any specifically for CodeGenerator.cpp:4665 but I might have missed it.
Robert Sample
Global moderator
 
Posts: 3160
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 190 times

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby BillyBoyo » Thu May 19, 2016 9:11 pm

No, there are no manuals documenting COBOL compiler messages.

The usual messages, from ERRMSG, and that you get once every three weeks in a compile(!), are "believed to be" self-explanatory. They have never been documented beyond the message texts themselves, and never will be.

The "assert" messages are hard-coded at those locations in the programs which are doing the work. If there is any documentation, it is within the IBM compiler team, and will never be public beyond specific public references of individual or types of messages. Anyway, they are just saying, "something unexpected has happened, and this is where it happened".
BillyBoyo
Global moderator
 
Posts: 3776
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 257 times

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby Aki88 » Thu May 19, 2016 9:23 pm

Honestly, for once I'd thought that maybe-maybe the assert messages would be documented somewhere, because to be honest for an app programmer this would come off as Greek and Swahili.

The colleague was able to figure out their code piece which was causing the compiler to act-up. It is a simple days-passed calculation copybook, which is currently in use by over a couple of thousand programs across the portfolio. The copybook call logic for our program is a copy-paste from a working logic.

The copybook code, when compiled stand-alone - compiles clean.
Same code with another program - compiles clean.
The code with this program - conks the compilation.

Still digging further.

Thanks again.
Aki88
 
Posts: 303
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 32 times
Been thanked: 27 times

Re: COBOL 5.1 Compilation Error: ./CodeGenerator.cpp:4665

Postby enrico-sorichetti » Thu May 19, 2016 9:54 pm

Honestly, for once I'd thought that maybe-maybe the assert messages would be documented somewhere, because to be honest for an app programmer this would come off as Greek and Swahili.

don' hold Your breath ...

in c/c++ asserts are a test of the unthinkable for which no recovery action is possible
I have seen many programs that when dealing with strings and the relative length had the code
assert ( the_string_length >= 0 )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2535
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 120 times

PreviousNext

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post