Page 2 of 3

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

PostPosted: Wed May 18, 2016 10:17 pm
by Aki88
This is an exact copy-paste of the manual:


000100 Identification Division.
000200 Program-ID. ErrMsg.
 

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

PostPosted: Thu May 19, 2016 12:02 am
by BillyBoyo
      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?

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

PostPosted: Thu May 19, 2016 12:22 am
by Aki88
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.

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

PostPosted: Thu May 19, 2016 1:31 am
by BillyBoyo
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 :-)

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

PostPosted: Thu May 19, 2016 2:25 am
by Robert Sample
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.

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

PostPosted: Thu May 19, 2016 11:13 am
by Aki88
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? >

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

PostPosted: Thu May 19, 2016 8:37 pm
by Robert Sample
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.

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

PostPosted: Thu May 19, 2016 9:11 pm
by BillyBoyo
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".

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

PostPosted: Thu May 19, 2016 9:23 pm
by Aki88
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.

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

PostPosted: Thu May 19, 2016 9:54 pm
by enrico-sorichetti
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 )