Re: Memory Corruption? Or Something Else?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed,  3 Jul 2024 09:31:54 -0400 (EDT)
Robert Heller <heller@xxxxxxxxxxxx> wrote:

> The code is available on GitHub here: 
> https://github.com/RobertPHeller/PiggyBank
> There is just one source file (there is a simple Makefile there as
> well).

Hi Robert, 

I tried to compile PiggyBank.cob with gcobol.   

	https://gitlab.cobolworx.com/COBOLworx/gcc-cobol/

I encountered syntax errors that surprised me, that I describe below.
(Sadly, I can't recommend gcobol to you, because it has no support for
SCREEN SECTION, and won't anytime soon because mainframe programs
usually rely on CICS for user interaction.)

Still, my curiosity got the better of me.  Could you tell me
please what version of COBOL you're using?  

$ make COBOL=/usr/local/gcc-cobol/bin/gcobol
/usr/local/gcc-cobol/bin/gcobol -o PiggyBank PiggyBank.cob
PiggyBank.cob:7: syntax error at 'RECORD'
cobol1: error: failed compiling PiggyBank.cob
make: *** [Makefile:51: PiggyBank] Error 1

(Thanks for the Makefile, btw, and especially for the "COBOL" variable!)

The first error was at 

	ORGANISATION IS RECORD BINARY SEQUENTIAL

The ISO standard does not admit "organisation" with an 's', nor "RECORD
BINARY" in that clause.  

What effect does RECORD BINARY have on the program?  It seems to me that
all COBOL files are organized in records, and handled as binary data.
COBOL has no notion of "text" files in the Posix sense.  There are LINE
SEQUENTIAL files, of course, but to COBOL that's a sequence of
variable-length records delimited by a newline character (usually).  

Later we encounter

	PiggyBank.cob:47: syntax error: 01 AccountData: invalid LEVEL
for OCCURS

The ISO standard specifically disallows OCCURS for Levels 01, 66, 77,
and 88. 

Regarding 1-based indexing,  gcobol by default rejects a 0 index value
for a table.  If the value is known at compile time, it's a
compile-time error, else it's a run-time error.  

Regards, 

--jkl




[Index of Archives]     [Gcc Help]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Info]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux