gixsql TEST001.cbl TEST001.cbsql -S -I. -I"C:\Users\stealth_droid\Documents\Gix\Examples\test001\bin\debug\x64" -I"C:\msys64\mingw64\share\gnucobol\copy" --esql-copy-exts "C:\Users\stealth_droid\Documents\Gix\Examples\test001\bin\debug\x64\sqlca.cpy" "C:\Users\stealth_droid\Documents\Gix\Examples\test001\bin\debug\x64\EMPREC.cpy"
TEST001.cbl(35): error: Wrong file format or unexpected end of file
C:\Users\stealth_droid\Documents\Gix\Examples\test001\bin\debug\x64\TEST001.cbl(35): error: syntax error, unexpected end of file
when i take away the copy statements the unexpected end of file error goes away.
I am trying to use with this syntax. I must be doing it wrong.
both the copybooks are not in the 'copy' dir. one is in the current dir and the other is in the 'copy' dir.
but i think it is the copy statement itself not being in the right format.
it was trying in the example to use ...
execsqlincludesqlcaend-exec
this is really messing me up because i cant go farther on the project until i get past it.
I am doing more reading on how to use gixpp and gixsql but this is my barrier for the time being.
thanks for any help,
jim
Last edit: Simon Sobisch 2024-12-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
--esql-copy-exts should get a comma separated list like cpy,copy (but I think you don't need that at all; they are definitely superfluous in your example as you include the file extension in the literal already)
you should only give the COBOL source file to be preprocessed in (you have a trailing EMPREC.cpy in your options - if you want to include that, you either have the full path in your program or only the name and specify its path to -I
So... you commonly don't want to put full paths anywhere, because of portability issues, and instead use the names and specify their folders in -I.
Note that gixpp (which is wrapped by gixsql) likely only needs the path to the copybooks that you include via preparser - in this case EXEC SQL INCLUDE SQLCA END-EXEC (and you should not expect the preparser to know of any other copybooks, so only use variables for binding that are in either those coypybooks and/or between EXEC SQL DECLARE SECTION END-EXEC. / EXEC SQL END DECLARE SECTION END-EXEC. blocks.
Lastly (I don't know if this works in either gixpp or cobc for the copybook) - if you have long literals that you want to continue via in column 7 - they don't have a "terminator" in the line before and go until last column of the code area in fixed format - so instead of
As an alternative to this COBOL85 line continuation (which is marked as obsolete since at least COBOL2023) you can use the literal continuation or literal concatenation, which work in both fixed-form and free-form reference format (not checked if they work for COPY/SQL INCLUDE):
Hi-
I am trying to use these statements.
the dash goes in line 7.
when i take away the copy statements the unexpected end of file error goes away.
I am trying to use with this syntax. I must be doing it wrong.
both the copybooks are not in the 'copy' dir. one is in the current dir and the other is in the 'copy' dir.
but i think it is the copy statement itself not being in the right format.
it was trying in the example to use ...
this is really messing me up because i cant go farther on the project until i get past it.
I am doing more reading on how to use gixpp and gixsql but this is my barrier for the time being.
thanks for any help,
jim
Last edit: Simon Sobisch 2024-12-09
https://stackoverflow.com/questions/78850297/gnucobol-3-2-0-copybooks
this seems to be the solution that works but if i didn't know about column 12 and this tip it is understandable how i could get stuck.
thanks to Jeremy.
have a cool day,
jim
Sent with Proton Mail secure email.
I highly suggest to read the matching docs or study the
--helpoptions of the tools used...Note: the gixsql wrapper does the following, so part of those are already used:
checking that with your command line shows:
--esql-copy-extsshould get a comma separated list likecpy,copy(but I think you don't need that at all; they are definitely superfluous in your example as you include the file extension in the literal already)EMPREC.cpyin your options - if you want to include that, you either have the full path in your program or only the name and specify its path to-ISo... you commonly don't want to put full paths anywhere, because of portability issues, and instead use the names and specify their folders in
-I.Note that gixpp (which is wrapped by gixsql) likely only needs the path to the copybooks that you include via preparser - in this case
EXEC SQL INCLUDE SQLCA END-EXEC(and you should not expect the preparser to know of any other copybooks, so only use variables for binding that are in either those coypybooks and/or betweenEXEC SQL DECLARE SECTION END-EXEC./EXEC SQL END DECLARE SECTION END-EXEC.blocks.Lastly (I don't know if this works in either gixpp or cobc for the copybook) - if you have long literals that you want to continue via in column 7 - they don't have a "terminator" in the line before and go until last column of the code area in fixed format - so instead of
use
As an alternative to this COBOL85 line continuation (which is marked as obsolete since at least COBOL2023) you can use the literal continuation or literal concatenation, which work in both fixed-form and free-form reference format (not checked if they work for
COPY/SQL INCLUDE):