Skip to main content

Hello, 


I am currently working on a Unix server (Redhat 8 and AIX 7.3) to compile Cobol programs by using Micro Focus Cobol V8.0 . To compile these programs I use the 'cob64' command line. When there are errors in source code, I get this kind of log (for AIX) :
*===============================================================*
* Micro Focus COBOL V8.0 revision 000 Compiler
* (C) Copyright 1984-2022 Micro Focus or one of its affiliates.
* REF GNR-078800000AM
* Total Messages: 1
* Unrecoverable : 0 Severe : 1
* Errors : 0 Warnings: 0
* Informational : 0 Flags : 0
* Data: 1546 Code: 0
------------------------------------------------------------------------
------------------------------------------------------------------------
THROW ERROR HERE
* 71-S******** **
** PROCEDURE DIVISION missing or unknown statement
cob64: error(s) in compilation: TESTERR.pcb
TESTERR.pcb - ERREUR DE PRE-COMPILATION COBOL

I want to retrieve the line where the error occurred but I don't understand where to find it. The only number that appears (here 71) is linked to the type of error and not to the line of source code.
Where can I find the lines associated with errors?

Thank you.


#VisualCOBOL
#COMPILER

Hello, 


I am currently working on a Unix server (Redhat 8 and AIX 7.3) to compile Cobol programs by using Micro Focus Cobol V8.0 . To compile these programs I use the 'cob64' command line. When there are errors in source code, I get this kind of log (for AIX) :
*===============================================================*
* Micro Focus COBOL V8.0 revision 000 Compiler
* (C) Copyright 1984-2022 Micro Focus or one of its affiliates.
* REF GNR-078800000AM
* Total Messages: 1
* Unrecoverable : 0 Severe : 1
* Errors : 0 Warnings: 0
* Informational : 0 Flags : 0
* Data: 1546 Code: 0
------------------------------------------------------------------------
------------------------------------------------------------------------
THROW ERROR HERE
* 71-S******** **
** PROCEDURE DIVISION missing or unknown statement
cob64: error(s) in compilation: TESTERR.pcb
TESTERR.pcb - ERREUR DE PRE-COMPILATION COBOL

I want to retrieve the line where the error occurred but I don't understand where to find it. The only number that appears (here 71) is linked to the type of error and not to the line of source code.
Where can I find the lines associated with errors?

Thank you.


#VisualCOBOL
#COMPILER

It looks like you may be using a pre-compiler as part of your compile process. Is this a COBOL program with embedded EXEC SQL statements perhaps? Can you share the complete cob64 command that you've used?

 

As mentioned in the documentation, the 71-S error indicates that the compiler can't find the PROCEDURE DIVISION header within the COBOL source program. If you are using a precompiler, it may be that the invocation of the precompiler is failing, or that the precompiler is not returning a valid COBOL source file to the COBOL compiler.

 

To learn more about the options being specified to the compiler, you might also try asking the COBOL compiler to list the compile directives that have been specified, by adding the the VERBOSE directive to those being specified on your command line. For example, try adding the bolded portion to your command:

 

$ cob64 -C"VERBOSE" <rest of cob64 command>


It looks like you may be using a pre-compiler as part of your compile process. Is this a COBOL program with embedded EXEC SQL statements perhaps? Can you share the complete cob64 command that you've used?

 

As mentioned in the documentation, the 71-S error indicates that the compiler can't find the PROCEDURE DIVISION header within the COBOL source program. If you are using a precompiler, it may be that the invocation of the precompiler is failing, or that the precompiler is not returning a valid COBOL source file to the COBOL compiler.

 

To learn more about the options being specified to the compiler, you might also try asking the COBOL compiler to list the compile directives that have been specified, by adding the the VERBOSE directive to those being specified on your command line. For example, try adding the bolded portion to your command:

 

$ cob64 -C"VERBOSE" <rest of cob64 command>

Hello,
Thank you for your reply. Here is the command I used:
cob -c -C'assign(external) LIST() NOFORM COPYLISTCOMMENT(7) NORESEQ' -k ${idname}.pcb

I have this kind of log for each source code, not only EXEC SQL. I found that the 'NORESEQ' is the explicit way to not print the lines so I removed it and now I got lines 🙂

Thanks again for your help in pointing me in the right direction.