Following program cause an internal compiler error.
>>SOURCE FORMAT IS FREE
ID DIVISION.
program-id. TESTENTRY.
DATA DIVISION.
LINKAGE SECTION.
01 wFIELD01-L PIC XX value NULL.
PROCEDURE DIVISION.
*> ENTRY 'aaaa' USING wFIELD01-L.
ENTRY 'myENTRY01' USING 'xxxxxxxxxx'.
*> FOLLOWING STATEMENTS CAUSE SAME INTERNAL COMPILER ERROR
*> ENTRY 'myENTRY01' USING omitted .
*> ENTRY 'myENTRY01' USING by CONTENT 'jjjj' .
*> ENTRY 'myENTRY01' USING by REFERENCE 'jjjj' .
*> ENTRY 'myENTRY01' USING by REFERENCE wFIELD01-L 'aaaaa' omitted.
GOBACK.
Messages from SuperBOL:
* Executing task: cobc -x -ftraceall -g -fformat=auto -std=default -ext cpy -ext cbl -ext cob TESTNULL.COB -I .
cobc: call to 'cb_ref' with invalid parameter 'x'
cobc: tree.c:5152: internal compiler error
cobc: aborting compile of TESTENTRY.COB at line 11 (PROGRAM-ID: TESTENTRY)
cobc: Please report this!
* The terminal process "C:\WINDOWS\System32\cmd.exe /d /c cobc -x -ftraceall -g -fformat=auto -std=default -ext cpy -ext cbl -ext cob TESTNULL.COB -I ." terminated with exit code: 3.
* Terminal will be reused by tasks, press any key to close it.
As likely kown that is "ice-invalid" (internal compiler error on invalid code).
cobc should error when using anything but data-items for the USING clause.
Interestingly gcobol has the exact same issue :-) I'll fill a bug report for that as well.
The updated PG and the old Grammar documentation currently contain what I'm attaching.
As far as I can see, ENTRY is a verb that does not exist in the ISO STANDARD:
Could you give me the correct syntax version ?
The USING clause needs to be adjusted - only BY REFERENCE (default) or BY VALUE, only
identifier(with identifier being a level 01/77 data-item in LINKAGE SECTION).The rest is fine (but the call-convention/linkage part being dialect specific).
Last edit: Simon Sobisch 2026-02-09
Then it should be as follows.
Can you confirm this ?
Last edit: Eugenio Di Lorenzo 2026-02-09
You said that
ENTRYonly allowsBY REFERENCEandBY VALUEbut bollowing sample useENTRY ... USING BY CONTENT ....and it compiles without errors.How come ?
That's a bug in the code - only the caller may define BY CONTENT (while the callee would use BY REFERENCE as a counter-side).
This is all in the same area of the code and will be fixed together.
I can confirm that the syntax diagram is the one you've posted above (with WITH ... LINKAGE being dialect specific and only be usable when the internal or standard-compliant manually defined call-convention mnemonic-name is not used),
ENTRY entry-name [USING identifier-1 [identifier-2].....] - (VSC2)
(OSV2) (MF)
ENTRY entry-name (MF)
[ USING { BY REFERENCE ] data-name-1 .... }... ]
[ { BY VALUE ] data-name-2 .... (MF) }... ] (MF) (OPSVS)
(VSC2)
Taken from MF COBOL for DOS, Windows, and OS/2 pocket guide issue 6
April 1993
The Workbench system and yes I do have the full manual/s
here. indecupboard.
On 09/02/2026 15:07, Eugenio Di Lorenzo wrote:
Related
Bugs: #1194