Closed MrT201509 closed 1 year ago
That comes from the used compiler, not from the IDE. Please create an issue at https://sourceforge.net/p/gnucobol/bugs/ including the version of the computer used.
I created an issue on GitHub Pages.
If you are using Gix-IDE and you are precompiling with GixSQL ("Precompile for ESQL" option enabled in the Properties window), this might - I cannot test it right now - be related to the fact that GixSQL does not behave well (meaning "at all") with lowercase variables and statements.
Could you please try to do one (or both) of these things?
1) disable ESQL precompilation in "Properties" (if not needed, obviously) 2) Make the "x" variable uppercase
Thanks
That's it! Thank you!
Solution tested: disable ESQL precompilation in "Properties". Build is now successful.
"Make the 'x' variable uppercase" doesn't fix the problem.
Obviously GixSQL currently drops the last line before PROCEDURE DIVISION
:
DATA DIVISION.
WORKING-STORAGE SECTION.
GIXSQL*01 X PIC X(1) VALUE "x".
GIXSQL* ESQL CURSOR INIT FLAGS (START)
GIXSQL* ESQL CURSOR INIT FLAGS (END)
PROCEDURE DIVISION.
DISPLAY X.
GIXSQL*
GIXSQL* ESQL CURSOR DECLARATIONS (START)
GIXSQL GO TO GIX-SKIP-CRSR-INIT.
GIXSQL GIX-SKIP-CRSR-INIT.
GIXSQL*
GIXSQL* ESQL CURSOR DECLARATIONS (END)
allowing the COBOL compiler only to say that it has no clue about X
in this last line. I guess that's an easy for @mridoni.
I moved the issue here since it is actually a GixSQL issue
Thank you for helping. I close the issue now.
Please reopen - the issue is a severe problem in gixpp which isn't fixed.
Fixed by dd9050ec0464a993cd2a4bbf4aee431b06c0bfd8. BTW: the same problem happened in the LINKAGE section, it was also fixed there.
Hello again. Given is the following program code:
IDENTIFICATION DIVISION. PROGRAM-ID. testwss. DATA DIVISION. WORKING-STORAGE SECTION. 01 x PIC X(1) VALUE "x". PROCEDURE DIVISION. DISPLAY x.
Compiler reports build-error:
TEST_WSS.cbsql(16): error: 'x' cannot be used here
Adding a new line at the end of the "WORKING-STORAGE SECTION" (with or without a comment or a definition of another variable) solves the problem:
IDENTIFICATION DIVISION. PROGRAM-ID. testwss. DATA DIVISION. WORKING-STORAGE SECTION. 01 x PIC X(1) VALUE "x".
PROCEDURE DIVISION. DISPLAY x.
This is very confusing!