Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocesql does not process periods correctly in include files #25

Open
yutaro-sakamoto opened this issue Aug 5, 2022 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@yutaro-sakamoto
Copy link
Contributor

prog.cbl

       IDENTIFICATION              DIVISION.
       PROGRAM-ID.                 prog.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       EXEC SQL INCLUDE SQLCA END-EXEC.
       PROCEDURE                   DIVISION.
       MAIN.
           IF 1 < 0
             EXEC SQL INCLUDE exec-disconnect END-EXEC
           END-IF.
           EXEC SQL INCLUDE exec-disconnect END-EXEC.

exec-disconnect

        EXEC SQL
          DISCONNECT ALL
        END-EXEC.

The following command fails.

ocesql prog.cbl prog.cob
cobj prog.cob

The cause is that ocesql inserts a call statement with a period inside an if statement.

       IDENTIFICATION              DIVISION.
       PROGRAM-ID.                 prog.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
OCESQL*EXEC SQL INCLUDE SQLCA END-EXEC.
OCESQL     copy "sqlca.cbl".
       PROCEDURE                   DIVISION.
       MAIN.
           IF 1 < 0
OCESQL*      EXEC SQL INCLUDE exec-disconnect END-EXEC
OCESQL* EXEC SQL
OCESQL*   DISCONNECT ALL
OCESQL* END-EXEC.
OCESQL     CALL "OCESQLDisconnect" USING
OCESQL          BY REFERENCE SQLCA
OCESQL     END-CALL.
           END-IF.
OCESQL*    EXEC SQL INCLUDE exec-disconnect END-EXEC.
OCESQL* EXEC SQL
OCESQL*   DISCONNECT ALL
OCESQL* END-EXEC.
OCESQL     CALL "OCESQLDisconnect" USING
OCESQL          BY REFERENCE SQLCA
OCESQL     END-CALL.
OCESQL*    EXEC SQL INCLUDE exec-disconnect END-EXEC.
OCESQL*    EXEC SQL INCLUDE exec-disconnect END-EXEC.
yutaro-sakamoto added a commit to yutaro-sakamoto/Open-COBOL-ESQL-4j that referenced this issue Aug 15, 2022
yutaro-sakamoto added a commit to yutaro-sakamoto/Open-COBOL-ESQL-4j that referenced this issue Aug 16, 2022
yutaro-sakamoto added a commit to yutaro-sakamoto/Open-COBOL-ESQL-4j that referenced this issue Aug 17, 2022
@yutaro-sakamoto yutaro-sakamoto self-assigned this May 1, 2024
@yutaro-sakamoto yutaro-sakamoto added the bug Something isn't working label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant