Skip to content

Conversation

@yutaro-sakamoto
Copy link
Contributor

This pull request add detailed error messages which are displayed when COBOL programs contain indexed record keys with duplicates.

For example, cobj displays prog.cbl:8: Error: Record keys with duplicates are not yet supported when compiling the following COBOL program because there is an indexed key TEST-KEY1 with duplicates.

       IDENTIFICATION   DIVISION.
       PROGRAM-ID.      prog.
       ENVIRONMENT      DIVISION.
       INPUT-OUTPUT     SECTION.
       FILE-CONTROL.
       SELECT TEST-FILE ASSIGN TO "./TEST-FILE"
                        ORGANIZATION IS  INDEXED
                        RECORD KEY   IS  TEST-KEY1 WITH DUPLICATES
                        ALTERNATE RECORD KEY IS ALT-KEY1
                                                ALT-KEY2.
       DATA             DIVISION.
       FILE             SECTION.
       FD TEST-FILE.
       01 TEST-REC.
          03 TEST-KEY1  PIC X(4).
          03 ALT-KEY1   PIC X(4).
          03 ALT-KEY2   PIC X(4).
       PROCEDURE        DIVISION.
           STOP RUN.

@yutaro-sakamoto yutaro-sakamoto merged commit 8ecf822 into opensourcecobol:develop Apr 19, 2024
@yutaro-sakamoto yutaro-sakamoto deleted the fix/record-key-duplicates branch April 19, 2024 11:42
This was referenced Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant