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

COPY REPLACING not working with GixSQL #187

Open
Leroy-Guillaume opened this issue Jun 25, 2024 · 0 comments
Open

COPY REPLACING not working with GixSQL #187

Leroy-Guillaume opened this issue Jun 25, 2024 · 0 comments

Comments

@Leroy-Guillaume
Copy link

Description:
The COPY REPLACING directive in COBOL does not seem to work when using the GixSQL precompiler to compile a COBOL program, whereas it works perfectly with GNUCOBOL (cobc).

Steps to Reproduce:

  1. Create a COBOL program zreplacing.cbl with the following content:

    identification division.
    program-id. zreplacing.
    environment division.
    data division.
    working-storage section.
    copy "ztest.tag" replacing ==(tag)== by ==wss==.
    
    procedure division.
        display "Hello, world!".
        goback.
        stop run.
  2. Create the copybook ztest.tag with the following content:

    1 (tag)-test.
        3 (tag)-firsttest pic 9(7).
        3 (tag)-secondtest pic 9(7).
  3. Compile the program using GixSQL:

    gixsql zreplacing.cbl zreplacing.cob

Expected Behavior:
The program should be precompiled without errors, similar to how it compiles with GNUCOBOL (cobc).

Actual Behavior:
The compilation fails with the following error:

zreplacing.cbl(6): error: syntax error, unexpected WORD

Additional Information:
The program compiles and runs perfectly when using GNUCOBOL with the following command:

cobc -m zreplacing.cbl
  1. Modify the COBOL program to remove the REPLACING clause:

    identification division.
    program-id. zreplacing.
    environment division.
    data division.
    working-storage section.
    copy "ztest.tag". *>replacing ==(tag)== by ==wss==.
    
    procedure division.
        display "Hello, world!".
        goback.
        stop run.
  2. Compile the modified program using GixSQL:

    gixsql zreplacing.cbl zreplacing.cob

Expected Behavior:
The program should be precompiled without errors.

Actual Behavior:
The precompilation works without any errors.

Environment:

  • GixSQL version: 1.0.20b
  • Operating System: Ubuntu 24.04 LTS
  • GNUCOBOL version: 3.2-rc2.0

The issue seems to be specific to the COPY REPLACING directive when using GixSQL.

Please provide guidance on how to resolve this issue or if a fix can be implemented in future versions.

Thank you for your assistance.

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

No branches or pull requests

1 participant