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

            Bug ID: 119793
           Summary: FR FE (parser): addition of BASED-STORAGE SECTION
                    (Fujitsu)
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: cobol
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simonsobisch at gnu dot org
  Target Milestone: ---

This section defines (apart from constants) only BASED storage items with an
explicit pointer reference. If used, then it has to be defined as first section
in the DATA DIVISION.

The pointers may be defined anywhere.

ISO COBOL, for example in WORKING-STORAGE section:

   01 SOME-VAR-MAY-BE-A-HUGE-RECORD  BASED.
      05 FILLER PIC X.
   01 my-data-ptr  POINTER.

Then _before the first use_:

   SET ADDRESS OF SOME-VAR-MAY-BE-A-HUGE-RECORD TO my-data-ptr

Side-note: a common _extension_ is allowing to SET the address of any record in
LINKAGE section (ISO allows this only if it is explicit BASED)


Fujitsu allows _additional_:

BASED-STORAGE
   01 SOME-VAR-MAY-BE-A-HUGE-RECORD  BASED ON my-data-ptr.
      05 FILLER PIC X.
WORKING-STORAGE  (or LINKAGE or wherever)
   01 my-data-ptr  POINTER.
then using the data-item "directly"

Reply via email to