Please see:
id division.
program-id. repo-fail.
environment division.
configuration section.
repository.
function fn1.
function fn2.
procedure division.
display "Hello world."
end-program. repo-fail.
The program fails to compile with:
$ cobc -xo repo-fail repo-fail.cob
repo-fail.cob:7: error: PROCEDURE DIVISION header missing
repo-fail.cob:7: error: syntax error, unexpected intrinsic function name
repo-fail.cob:9: error: syntax error, unexpected PROCEDURE
repo-fail.cob:11: error: 'end-program' is not defined
$ vi repo-fail.cob
The program compiles correctly with the second function definition
removed or commented out. `cobc` version information:
$ cobc --version
cobc (GnuCOBOL) 3.1.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html <https://gnu.org/licenses/gpl.html>>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch,
Edward Hart
Built May 31 2022 11:49:28
Packaged Dec 23 2020 12:04:58 UTC
C version "Apple LLVM 13.1.6 (clang-1316.0.21.2.5)"
$
Thanks for looking at this.
--
Marty Heyman