Hello, (I think) I am using vscode to run a bat file (yes, Windows) as my make file. The esqloc precompile is adding some comments at the end of my source code. These comment lines are creating two error lines that vscode / problem tab shows:
[{ "resource": "/d:/app/GNU/source/esqlocTest.cob", "owner": "_generated_diagnostic_collection_name_#0", "severity": 8, "message": "Source text cannot go past column 80", <===== "source": "COBOL Language Support (preprocessing)", "startLineNumber": 478, "startColumn": 81, "endLineNumber": 478, "endColumn": 84}]
THESE ARE THE comment lines that get appended to my source code:
********************************************************************** * : ESQL for GnuCOBOL/OpenCobol Version 2 (2021.05.29) Build May 29 2021 ******* EMBEDDED SQL VARIABLES USAGE ******* * BUFFER IN USE CHAR(1024) * CUR_ALL IN USE CURSOR * HOSTVARS NOT IN USE * HOSTVARS.BUFFER NOT IN USE * HOSTVARS.HVARC NOT IN USE * HOSTVARS.HVARD NOT IN USE * HOSTVARS.HVARN NOT IN USE * HVARC IN USE CHAR(50) * HVARD IN USE THROUGH TEMP VAR SQL-VAR-0001 DECIMAL(7,2) * HVARN IN USE THROUGH TEMP VAR SQL-VAR-0002 DECIMAL(13,0) **********************************************************************
The last two lines exceed column 80.
Has this been fixed? Is there a fix? Is there a parameter to get around this problem?
DRIVAL!
I was given a software package circa 1985 written in Microfocus COBOL and it does not run(compile) on Windows Server 2022. The system uses Parkway ODBC connector - I think because the COBOL code does not use dynamic SQL. It has Read, Read next and write statements. Since I can't find any examples of GNUCOBOL using standard Read Writes, I guess I will have to convert the code to use dynamic SQL? Anyway, I am looking at GNUCOBOL to replace Microfocus. (if I can get it to work)
Last edit: Simon Sobisch 2024-04-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't see any esqlOC ver 3 binaries for windows. So, I guess that means I have to compile the version 3 of esqloc? I should be able to use gcc to compile C++, yes? Into a esqloc.dll and (if successful) that is all I need in a new esqloc directory?
Last edit: A David Wulkan 2024-04-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure I have good setup? Could you please look at my attachments and tell me if I have good compiler? the first error message from cobc.exe says this: D:\app\GNU\source\app003.cob:7: error: PROGRAM-ID header missing
I suppose :7: means line 7 but, Line 7 looks like this: " 7 > * 20181003 dw PAR-162. Fixed ADI000 so will not remember the"
My source file compiles in the Microfocus compiler but GNUCobol appears to not even like the line numbers in columns 1-6?
I'm attaching
my source code app003.cob,
my make file, make.bat
and a copy of the cobc.exe output from vscode.
Trying to match the error mesage to the source code line is driving me crazy.
You have specified on the command line
cobc.exe -fixed -v -x -static -free -o D:\app\GNU\source\app003.exe
D:\app\GNU\source\app003.cob
but the program is fixed format.
change -free for -fixed and try again
When I tried it it only fails not finding the copy books.
when using gc v3.2 under Linux.
.
On 16/04/2024 04:37, A David Wulkan wrote:
I'm not sure I have good setup? Could you please look at my
attachments and tell me if I have good compiler? the first error
message from cobc.exe says this: D:\app\GNU\source\app003.cob:7:
error: PROGRAM-ID header missing
I suppose :7: means line 7 but, Line 7 looks like this: " 7 > *
20181003 dw PAR-162. Fixed ADI000 so will not remember the"
My source file compiles in the Microfocus compiler but GNUCobol
appears to not even like the line numbers in columns 1-6?
I'm attaching
my source code app003.cob,
my make file, make.bat
and a copy of the cobc.exe output from vscode.
Trying to match the error mesage to the source code line is driving me
crazy.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Four warnings and one error
+ error is beccause of missing end-perform
+ The missing end-perform is not a problem for my microfocus compiler?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D:\app\GNU\source\app003.cob:91: warning: OCCURS DEPENDING ON without TO phrase used [-Wdialect]
89 | 001050 01 CLEAR-SCREEN.
90 | 001060 05 CLEAR-LINE PIC X(80) OCCURS 25
91 > DEPENDING ON CL-LIN.
[ Microfocus did not require the 'TO' phrase in it's COBOL syntax?]
D:\app\GNU\source\app003.cob:75: warning: value size exceeds data size [-Wothers]
73 | 03 MOUSE-STATUS PIC 9(4) COMP-X.
74 | 01 cursor-off-screen.
75 > 05 row-number pic 99 comp-x value 255.
76 | 05 col-number pic 99 comp-x value 255.
[ row-number is 01 thru 25 and col-number is 01 thru 80. I thought comp-x is binary just as comp-5 is? Seems like pic 99 should work. Microfocus (circa 1985) had no problem with this.]
D:\app\GNU\source\app003.cob:76: warning: value size exceeds data size [-Wothers]
74 | 01 cursor-off-screen.
75 | 05 row-number pic 99 comp-x value 255.
76 > 05 col-number pic 99 comp-x value 255.
[ row-number is 01 thru 25 and col-number is 01 thru 80. I thought comp-x is binary just as comp-5 is? Seems like pic 99 should work. Microfocus (circa 1985) had no problem with this.]
[ I've never seen a cobol language that flagged the FILLER keyword?]
D:\app\GNU\source\app003.cob:417: error: PERFORM statement not terminated by END-PERFORM
415 | IF A < 1 OR A > MAXREC
416 | GO TO PAR-160.
417 > PERFORM VARYING X-US FROM 1 BY 1 UNTIL X-US > 41
418 | IF A = VALID-LINES(X-US)
419 | MOVE X-US TO A
The PERFORM statement is an inline PERFORM statement, when procedure-name-1 is omitted.
The PERFORM statement is an out-of-line PERFORM statement, when procedure-name-1 is specified.
An inline PERFORM must be delimited by the END-PERFORM phrase.
[ THis is the first time I've heard of this syntax requirement. Maybe this is IBM convention or a cobol version after 1985? Microfocus seemed to be OK with this.]
D:\app\GNU\source\app003.cob: in paragraph 'EVALUATE-MOUSE-BUTTON':
D:\app\GNU\source\app003.cob:527: error: PERFORM statement not terminated by END-PERFORM
525 | END-EVALUATE
526 | ELSE
527 > PERFORM VARYING INX FROM 1 BY 1 UNTIL INX > MAXREC
528 | IF MOUSE-Y-POSITION = SCR-LOC-ROW(INX)
529 | AND (MOUSE-X-POSITION >= SCR-LOC-FR-COL(INX) AND
[ See above ]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I suggest you look at the compiler command functions obtained by running
cobc -h
The end-verb can be turned off as well as many other warnings if you
really need to so look at what you are using as it is possible you have
turned these warnings on be default of using a setting as it looks like
you have one of the strict settings in use.
So far, the 'non issues' you are having relates to the way you are using
the compiler i.e., command line settings etc.
"Read the manual Luke " or in mainframe terms RTFM
They are updated often if errors are found and reported.
On 16/04/2024 16:46, A David Wulkan wrote:
20240416 11:42 EDT
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Four warnings and one error
+ error is beccause of missing end-perform
+ The missing end-perform is not a problem for my microfocus compiler?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D:\app\GNU\source\app003.cob:91: warning: OCCURS DEPENDING ON without
TO phrase used [-Wdialect]
89 | 001050 01 CLEAR-SCREEN.
90 | 001060 05 CLEAR-LINE PIC X(80) OCCURS 25
91 > DEPENDING ON CL-LIN.
[ Microfocus did not require the 'TO' phrase in it's COBOL syntax?]
Getting Started: esqlOC by Sergey?
Hello, (I think) I am using vscode to run a bat file (yes, Windows) as my make file. The esqloc precompile is adding some comments at the end of my source code. These comment lines are creating two error lines that vscode / problem tab shows:
TRIVIAL DETAIL?:
THESE ARE THE comment lines that get appended to my source code:
The last two lines exceed column 80.
Has this been fixed? Is there a fix? Is there a parameter to get around this problem?
DRIVAL!
I was given a software package circa 1985 written in Microfocus COBOL and it does not run(compile) on Windows Server 2022. The system uses Parkway ODBC connector - I think because the COBOL code does not use dynamic SQL. It has Read, Read next and write statements. Since I can't find any examples of GNUCOBOL using standard Read Writes, I guess I will have to convert the code to use dynamic SQL? Anyway, I am looking at GNUCOBOL to replace Microfocus. (if I can get it to work)
Last edit: Simon Sobisch 2024-04-14
That should only be a warning, so at the very first I'd suggest you check with the vscode extension you use that they reduce the severity.
In any case as you only edit with vscode, this should be no problem, right?
Compiling with
cobcshould not raise an error.Last edit: Simon Sobisch 2024-04-14
In any case: note that esqlOC 2 (from May 2021) is heavily outdated, you want tot use a version 3 (from at least 2022).
I've been searching for "download esqlOC version 3" and have not found a source. Can you plese point me in the right direction? Thanks
I just found this: https://sourceforge.net/p/gnucobol/contrib/HEAD/tree/trunk/esql/ Is this what I'm looking for?
I don't see any esqlOC ver 3 binaries for windows. So, I guess that means I have to compile the version 3 of esqloc? I should be able to use gcc to compile C++, yes? Into a esqloc.dll and (if successful) that is all I need in a new esqloc directory?
Last edit: A David Wulkan 2024-04-15
The easiest thing would be to use a mingw shell then run
autogen.sh, followed by./configure && maketo get the most current binaries.Note that @ska00 does provide 3.0 binaries (but those are currently early 2022, not most current one) at http://www.kiska.net/opencobol/esql/.
I'm not sure I have good setup? Could you please look at my attachments and tell me if I have good compiler? the first error message from cobc.exe says this: D:\app\GNU\source\app003.cob:7: error: PROGRAM-ID header missing
I suppose :7: means line 7 but, Line 7 looks like this: " 7 > * 20181003 dw PAR-162. Fixed ADI000 so will not remember the"
My source file compiles in the Microfocus compiler but GNUCobol appears to not even like the line numbers in columns 1-6?
I'm attaching
my source code app003.cob,
my make file, make.bat
and a copy of the cobc.exe output from vscode.
Trying to match the error mesage to the source code line is driving me crazy.
You have specified on the command line
cobc.exe -fixed -v -x -static -free -o D:\app\GNU\source\app003.exe
D:\app\GNU\source\app003.cob
but the program is fixed format.
change -free for -fixed and try again
When I tried it it only fails not finding the copy books.
when using gc v3.2 under Linux.
.
On 16/04/2024 04:37, A David Wulkan wrote:
Thanks for the help. I changed line two in app003.cob to this:
$SET ans85 cb_std_def(CB_STD_MF) assign(external) nodetectlock FIXED
And it went from 50 errors down to 11. Also, it is now finding (or maybe just not complaining about) the copybooks.
20240416 11:42 EDT
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Four warnings and one error
+ error is beccause of missing end-perform
+ The missing end-perform is not a problem for my microfocus compiler?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D:\app\GNU\source\app003.cob:91: warning: OCCURS DEPENDING ON without TO phrase used [-Wdialect]
89 | 001050 01 CLEAR-SCREEN.
90 | 001060 05 CLEAR-LINE PIC X(80) OCCURS 25
91 > DEPENDING ON CL-LIN.
[ Microfocus did not require the 'TO' phrase in it's COBOL syntax?]
D:\app\GNU\source\app003.cob:75: warning: value size exceeds data size [-Wothers]
73 | 03 MOUSE-STATUS PIC 9(4) COMP-X.
74 | 01 cursor-off-screen.
75 > 05 row-number pic 99 comp-x value 255.
76 | 05 col-number pic 99 comp-x value 255.
[ row-number is 01 thru 25 and col-number is 01 thru 80. I thought comp-x is binary just as comp-5 is? Seems like pic 99 should work. Microfocus (circa 1985) had no problem with this.]
D:\app\GNU\source\app003.cob:76: warning: value size exceeds data size [-Wothers]
74 | 01 cursor-off-screen.
75 | 05 row-number pic 99 comp-x value 255.
76 > 05 col-number pic 99 comp-x value 255.
[ row-number is 01 thru 25 and col-number is 01 thru 80. I thought comp-x is binary just as comp-5 is? Seems like pic 99 should work. Microfocus (circa 1985) had no problem with this.]
D:\app\GNU\source\app003.cob:194: warning: 'FILLER' does nothing [-Wothers]
192 | 03 BACKGROUND-COLOR 1 FOREGROUND-COLOR 7
193 | HIGHLIGHT BLANK SCREEN.
194 > 05 FILLER PIC X(1980).
[ I've never seen a cobol language that flagged the FILLER keyword?]
D:\app\GNU\source\app003.cob:417: error: PERFORM statement not terminated by END-PERFORM
415 | IF A < 1 OR A > MAXREC
416 | GO TO PAR-160.
417 > PERFORM VARYING X-US FROM 1 BY 1 UNTIL X-US > 41
418 | IF A = VALID-LINES(X-US)
419 | MOVE X-US TO A
https://www.ibm.com/docs/en/cobol-zos/6.4?topic=statements-perform-statement
Inline and out-of-line PERFORM statements
The PERFORM statement is an inline PERFORM statement, when procedure-name-1 is omitted.
The PERFORM statement is an out-of-line PERFORM statement, when procedure-name-1 is specified.
An inline PERFORM must be delimited by the END-PERFORM phrase.
[ THis is the first time I've heard of this syntax requirement. Maybe this is IBM convention or a cobol version after 1985? Microfocus seemed to be OK with this.]
D:\app\GNU\source\app003.cob: in paragraph 'EVALUATE-MOUSE-BUTTON':
D:\app\GNU\source\app003.cob:527: error: PERFORM statement not terminated by END-PERFORM
525 | END-EVALUATE
526 | ELSE
527 > PERFORM VARYING INX FROM 1 BY 1 UNTIL INX > MAXREC
528 | IF MOUSE-Y-POSITION = SCR-LOC-ROW(INX)
529 | AND (MOUSE-X-POSITION >= SCR-LOC-FR-COL(INX) AND
[ See above ]
I suggest you look at the compiler command functions obtained by running
cobc -h
The end-verb can be turned off as well as many other warnings if you
really need to so look at what you are using as it is possible you have
turned these warnings on be default of using a setting as it looks like
you have one of the strict settings in use.
So far, the 'non issues' you are having relates to the way you are using
the compiler i.e., command line settings etc.
"Read the manual Luke " or in mainframe terms RTFM
i.e., Programmer Guide or Reference.
These you can find and download them at :
https://gnucobol.sourceforge.io/guides.html
They are updated often if errors are found and reported.
On 16/04/2024 16:46, A David Wulkan wrote: