Skip to content

RENAMES cannot be related to an OCCURS #2819

@efr15

Description

@efr15

Describe the bug
A level 66 cannot rename / be contained in an item specifying the OCCURS clause.

To Reproduce

       IDENTIFICATION DIVISION.
       PROGRAM-ID. TCOCCL66.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
        01 MAIN-GRP1.
           05 GRP1 OCCURS 2.
                10 VAR1 PIC X.
      * KO: a level 66 cannot be contained in an item specifying OCCURS
                66 VAR1-RENAME RENAMES VAR1.
        01 MAIN-GRP2.
           05 GRP2.
                10 VAR2 PIC X OCCURS 2.
      * KO: a level 66 cannot rename an item specifying OCCURS
                66 VAR2-RENAME RENAMES VAR2.
       PROCEDURE DIVISION.
           GOBACK
           .
       END PROGRAM TCOCCL66.

Expected behavior
A diagnostic should be created for the line corresponding to the RENAMES definition.

Here is the IBM error message:
The"RENAMES"object"VARx-RENAME"contained, or was subordinate to, an item whose definition contained an"OCCURS"clause. The"RENAMES"clause was discarded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCobolUser VisibleVisible by the end user. Useful to priorize issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions