https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121339

            Bug ID: 121339
           Summary: extension CALL ... USING fd-name missing
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: cobol
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simonsobisch at gnu dot org
  Target Milestone: ---

Seen in a program that does


           MOVE 47 TO Z-X91-FUNCTION.
           CALL x"91" USING Z-X91-RESULT
                            Z-X91-FUNCTION
                            FD-NAME.

where that is defined by


           SELECT  FD-NAME         ASSIGN           TO Z-FILE-NAME
                                   ORGANIZATION     IS SEQUENTIAL
                                   ACCESS           IS SEQUENTIAL.

I did not found a rule in ISO COBOL that allows this, but know that at least
ACUCOBOL-GT and Visual COBOL (as well as older COBOL compilers from Micro
Focus) and IBM COBOL allows that.

Here is ACUCOBOL-GTs rule for CALL ... USING parameter...

> parameter is any non-level 88 data item or a literal. It may be subscripted 
> and reference modified. It may be the SELECT name of an open COBOL file.


The _result_ may be different between the compilers, IBM documents "a control
block is passed" and at least one compiler passed the internal "FILE *", which
is possibly the reasonable option for gcobol as well.

Reply via email to