[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-GnuCOBOL] produces uncompilable c code
From: |
David Newall |
Subject: |
Re: [Bug-GnuCOBOL] produces uncompilable c code |
Date: |
Thu, 30 Mar 2017 12:43:25 +1030 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
Is the syntax correct for PROCEDURE DIVISION?
I think BY VALUE belongs in the corresponding CALL to TESTMOVE. All
syntax charts I've found say it's not allowed there, and RM/COBOL agrees.
As others have already pointed out, the level for BYTES is invalid;
change it to GRP.
Also, shouldn't there be a procedure name on the line following
PROCEDURE DIVISION?
The following compiles (under GnuCOBOL and RM/COBOL):
IDENTIFICATION DIVISION.
PROGRAM-ID. TESTMOVE.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
LINKAGE SECTION.
01 GRP.
03 BYTES PIC 9(2) COMP-5 OCCURS 2.
77 MEM-ADDR POINTER.
PROCEDURE DIVISION USING MEM-ADDR.
TEST-IT.
SET ADDRESS OF GRP TO MEM-ADDR.
GOBACK.
END PROGRAM TESTMOVE.