Please have a look on my previous posts above (you may have missed it): https://sourceforge.net/p/gnucobol/discussion/help/thread/59e651b2c7/?limit=25#eb3e/0a15/fed0/0161 I figured out, how we can do it with the WinBGm-library with SuperBOL-AIO and provided a little howto with examples and the commands to compile it. Screenshot is also attached there. The second example opens a new window with the graphics output (lines, rectangle and circle) :-)
Now, we have some more functions available: >>SOURCE FREE IDENTIFICATION DIVISION. PROGRAM-ID. GFXDEMO. DATA DIVISION. WORKING-STORAGE SECTION. 78 C-BLACK VALUE 0. 78 C-BLUE VALUE 1. 78 C-GREEN VALUE 2. 78 C-CYAN VALUE 3. 78 C-RED VALUE 4. 78 C-MAGENTA VALUE 5. 78 C-BROWN VALUE 6. 78 C-LIGHTGRAY VALUE 7. 78 C-DARKGRAY VALUE 8. 78 C-LIGHTBLUE VALUE 9. 78 C-LIGHTGREEN VALUE 10. 78 C-LIGHTCYAN VALUE 11. 78 C-LIGHTRED VALUE 12. 78 C-LIGHTMAGENTA VALUE 13. 78 C-YELLOW VALUE 14. 78 C-WHITE VALUE 15. 01...
Ok, I think we are on the good way with winbgm/putpixel() on SuperBOL-AIO-distribution :-) 1) Library (always check it with virustotal.com) and graphics.h from: https://github.com/dbautsch/winbgim/releases/tag/6.0a 2) Rename libbgi64.a to libbgi.a and put it into: C:\Users\YOURUSER\AppData\Local\GnuCOBOL\mingw64\lib\gcc\x86_64-w64-mingw32\13.2.0 3) Put graphics.h (from the Source Code ZIP file) into: C:\Users\YOURUSER\AppData\Local\GnuCOBOL\mingw64\lib\gcc\x86_64-w64-mingw32\13.2.0\include 4) Compile...
Ok, I think we are on the good way with winbgm/putpixel() on SuperBOL-AIO-distribution :-) 1) Library (always check it with virustotal.com) and graphics.h from: https://github.com/dbautsch/winbgim/releases/tag/6.0a 2) Rename libbgi64.a to libbgi.a and put it into: C:\Users\YOURUSER\AppData\Local\GnuCOBOL\mingw64\lib\gcc\x86_64-w64-mingw32\13.2.0 3) Put graphics.h (from the Source Code ZIP file) into: C:\Users\YOURUSER\AppData\Local\GnuCOBOL\mingw64\lib\gcc\x86_64-w64-mingw32\13.2.0\include 4) Compile...
Thank you very much. I searched now for a 64-bit version and found this one for MinGW: https://github.com/dbautsch/winbgim/releases/tag/6.0a The binary libbgi64.a looks ok while checked with virustotal (please recheck if you want to use it). We need to extract the graphics.h from the file "Source code (zip)" and put it into include folder of the SuperBOL-installation ... and we need to put ibbgi64.a into the libs folder... Tomorrow (or within the next days) I will try to compile the example from...
Some hints I found to this topic: putpixel() is part of the Borland BGI Graphics emulation (based on https://en.wikipedia.org/wiki/Borland_Graphics_Interface ): https://winbgim.codecutter.org/ But unfortunately this is just für MinGW-32 and so it does not work with the SuperBOL-distribution which is shipped with MinGW-64. It should work with the distribution of Arnold because this is based on MinGW-32 but this comes without g++ (C++ compiler). But g++ ist needed because in the graphics.h the file...
Thank you very much. Additional finding with Hex Editor-Plugin (VSCode) after converting/reconverting: The issue seems to occur specifically when Ctrl+Z (0x1A) follows a CR (0x0D) without a trailing LF (0x0A). Working file ending: CR LF SUB Failing file ending: CR SUB c:\_Share\Bug-Report-SUB-EOF>cobc -x HELLO-OK.cob HELLO-OK.cob:1: warning: ignoring unknown directive: '@OPTIONS MAIN' [-Wothers] 1 > 000020 @OPTIONS MAIN 2 | 000021 Identification Division. 3 | 000030 Program-Id. Hello. c:\_Share\Bug-Report-SUB-EOF>cobc...
Thank you very much. Additional finding with Hex Editor-Plugin (VSCode): The issue seems to occur specifically when Ctrl+Z (0x1A) follows a CR (0x0D) without a trailing LF (0x0A). Working file ending: CR LF SUB Failing file ending: CR SUB c:\_Share\Bug-Report-SUB-EOF>cobc -x HELLO-OK.cob HELLO-OK.cob:1: warning: ignoring unknown directive: '@OPTIONS MAIN' [-Wothers] 1 > 000020 @OPTIONS MAIN 2 | 000021 Identification Division. 3 | 000030 Program-Id. Hello. c:\_Share\Bug-Report-SUB-EOF>cobc -x HELLO-NOK.cob...
cobc enters infinite loop when compiling source files containing Ctrl+Z (ASCII 26) EOF marker on Windows
With the hints from Simon I tested it on my Android Phone and I am really surprised that it works well without a big effort. Great :-) These are my steps: Installing Termux App from Playstore. Open the App - we are just in a shell. Updating the system: pkg update pkg upgrade Installing GnuCOBOL: pkg add gnucobol (it comes with json, xml and vbisam) clang is important, too. But it doesn't come automatically, so I installed it with: pkg add clang Now, cobc --versionworks. Version is 3.2. Then create...
With the hints from Simon I tested it on my Android Phone and I am really surprised that it works well without a big effort. Great :-) These are my steps: Installing Termux App from Playstore. Open the App - we are just in a shell. Updating the system: pkg update pkg upgrade Installing GnuCOBOL: pkg add gnucobol (it comes with json, xml and vbisam) clang is important, too. But it doesn't come automatically, so I installed it with: pkg add clang Now, cobc --versionworks. Version is 3.2. Then create...
I dont know it for sure but maybe in the early days of COBOL there was no possibility for masking the character " itself like \" or "" like in other languages? Personally I found this code more readable with the usage of QUOTE instead of using the character " six more times: IDENTIFICATION DIVISION. PROGRAM-ID. quotes-test. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-NAME PIC X(20) VALUE "Lara". 01 WS-CITY PIC X(20) VALUE "Munich". 01 WS-AGE PIC 99 VALUE 42. 01 WS-CSV-LINE PIC X(100). PROCEDURE...
Ok, these are the results on the Ubuntu 25.10 on AMD Ryzen 7 6800H: GnuCOBOL 4-early, MF and gcobol: with cobc -x mathtest.cbl -ftrunc -O Display-Item +500000007 USAGE DISPLAY: 55.68 SECONDS Comp-3-Item +500000007 USAGE COMP-3: 4.96 SECONDS Comp-Item +500000007 USAGE COMP: 35.49 SECONDS Comp-5-Item -0794967289 USAGE COMP-5: 0.16 SECONDS Binary-Item -0794967289 USAGE BINARY: 35.36 SECONDS ********************************** with cobc -x mathtest.cbl -fnotrunc -O Display-Item 500000007+ USAGE DISPLAY:...
Interesting topic :-) For gcobol (gcobol-15) I did not found how we can pass or activate ftrunc/fnotrunc option. Do they exist on gcobol, too? But these are the result so far with cobc, cob and gcobol: cobc (GnuCOBOL) 4.0-early-dev.0 from SVN-Source (gcc-15, std=gnu17) Micro Focus Visual COBOL for Eclipse 10.0 gcobol-15 from standard Ubuntu repo Machine: Ubuntu 25.10 on AMD Ryzen 7 6800H with Radeon Graphics cobc which "USAGE DISPLAY" is much faster on this setup relatively to the other positions...
This are the results on Ubuntu 24.04 with gcc 13.3.0. Please see details in the attached log (cobc --info). with cobc -x mathtest.cbl -ftrunc USAGE DISPLAY: 0.97 SECONDS USAGE COMP: 0.64 SECONDS USAGE COMP-5: 0.05 SECONDS USAGE BINARY: 0.67 SECONDS ********************************** with cobc -x mathtest.cbl -fnotrunc USAGE DISPLAY: 0.97 SECONDS USAGE COMP: 0.12 SECONDS USAGE COMP-5: 0.04 SECONDS USAGE BINARY: 0.11 SECONDS ********************************** with cob -x mathtest.cbl -C TRUNC USAGE...
Linux Ubuntu on Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz: cobc (GnuCOBOL) 3.3-dev.0 cobc -x mathtest.cbl ./mathtest USAGE DISPLAY: 0.98 SECONDS USAGE COMP: 0.66 SECONDS USAGE COMP-5: 0.05 SECONDS USAGE BINARY: 0.66 SECONDS Micro Focus COBOL Community Edition 11.0 cob -x mathtest.cbl ./mathtest USAGE DISPLAY: 0.16 SECONDS USAGE COMP: 0.02 SECONDS USAGE COMP-5: 0.02 SECONDS USAGE BINARY: 0.03 SECONDS
make issue cobfile (bin/Makefile.am) / undefined reference to `readline' / Ubuntu 25.04
Another test with the "new" GCC Cobol Compiler Frontend. Leading and trailing comma is displayed here: gcobol --version gcobol (Ubuntu 15.2.0-4ubuntu4) 15.2.0 Copyright (C) 2025 Free Software Foundation, Inc. gcobol pic-test.cob -o pic-test ./pic-test >,000012.34,< Compiling with -dialectgnu or -dialectmf doesn't change the output.
That's interesting. I experimented with a leading and a trailing comma in the PIC clause. IDENTIFICATION DIVISION. PROGRAM-ID. pic-test. DATA DIVISION. WORKING-STORAGE SECTION. 01 CALC-COMMISSION-FIELDS. 05 filler PIC X value ">". 05 CALC-SALES PIC ,9(6)V99, VALUE 12.34. 05 filler PIC X value "<". PROCEDURE DIVISION. DISPLAY CALC-COMMISSION-FIELDS STOP RUN. A trailing comma is completely ignored. A leading comma is treated as whitespace or as a comma itself. cobc (GnuCOBOL) 3.3-dev.0 cobc -x pic-test.cob...
I tested it on macOS 15.7.1 (ARM) with the latest 3.3 updates: svn info Pfad: . Wurzelpfad der Arbeitskopie: /Users/mds/cobol/gnucobol-3.x URL: svn://svn.code.sf.net/p/gnucobol/code/branches/gnucobol-3.x Letzter Autor: sf-mensch Letzte geänderte Rev: 5626 Letztes Änderungsdatum: 2025-12-06 02:59:21 +0100 (Sa, 06. Dez 2025) cobc -v cobc (GnuCOBOL) 3.3-dev.0 Built Dec 12 2025 23:14:12 Packaged Dec 12 2025 22:14:04 UTC C version "Apple LLVM 17.0.0 (clang-1700.3.19.1)" cobc -x bug1165v01.cbl ./bug1165v01...
What I have learned so far is ocesql is just for PostgreSQL. With gixsql we can use SQLite, PostgreSQL, MariaDB, Oracle, ODBC. I have Ubuntu 25.10 with: g++ --version g++ (Ubuntu 15.2.0-4ubuntu4) 15.2.0 To get gixsql run with the code from the pull request #207 I did these steps: git clone https://github.com/mridoni/gixsql.git cd gixsql git fetch origin pull/207/head:pr-207 git switch pr-207 ./prepbuild.sh touch extra_files.mk autoreconf -fi ./configure Then, before make we need to fix these files:...
Wow, I just tried it too. Current code from GC3.3-dev plus tcc 0.9.27 on Ubuntu 24.04. make checkall runs completely and the program GERMAN.cob (see above) can also be compiled and works correctly with this tcc-cobc version. Congratulations and respect for both, cobc and tcc.
That's a good result!! As a tip for people who like to use the fixed format: vertical lines can be displayed in the editor for the special COBOL columns. To do this, add the following to the settings.json of VS Code: "[cobol]": { "editor.rulers": [ 6,7,11,72,80 ] }, "editor.guides.indentation": false, Simon has already posted this here, too: https://sourceforge.net/p/gnucobol/discussion/help/thread/0e3e3ebf1f/?limit=25#9a4c/47f5 This is nice and helpful for fixed format programs in my opinion. One...
Hello Boris, Thank you very much. I will further investigate the problem(s) and will open a ticket on github. Probably this take some days for me but I will do so. Today I spent some hours to bring debugging run on my Ubuntu 24.04 with VS Code and a fresh self compiled GnuCOBOL from the 3.x-branch (SVN Rev 5593) but without success, too. In the generated tasks.json the SuperBOL macro definitions for debugging etc. are yellowed lined, so debug build will not add -g etc. to the cobc parameter list....
Hello Boris, Thank you very much. I will further investigate the problem(s) and will open a ticket on github. Probably this take some days for me but I will do so. Today I spent some hours to bring debugging run on my Ubuntu 24.04 with VS Code and a fresh self compiled GnuCOBOL from the 3.x-branch (SVN Rev 5593) but without success, too. In the generated tasks.json the SuperBOL macro definitions for debugging etc. are yellowed lined, so debug build will not add -g etc. to the cobc parameter list....
Sorry, you are fully right. SuperBOL-GnuCOBOL with VS Code with extension "SuperBOL Studio OSS" works out of the box on Windows . No need to add a special task.json or something else. I have a small hello.cob program for testing and it works so far but watch the value variable AGE is not possible. Maybe am oversee something. None of the variables is displayed on the left-hand window "Variables". Same under Ubuntu. I think I make something wrong with debugging with SuperBOL Studio in general. Please...
Sorry, you are fully right. SuperBOL-GnuCOBOL with VS Code with extension "SuperBOL Studio OSS" works out of the box on Windows . No need to add a special task.json or something else. I have a small hello.cob program for testing and it works so far but watch the value variable AGE is not possible. Maybe am oversee something. Please have a look on the screenshot. Could someone help please? PS: Command which executed bei F5 is: cobc -x -ftraceall -g -fformat=auto -std=default -ext cpy -ext cbl -ext...
Sorry, you are fully right. SuperBOL-GnuCOBOL with VS Code with extension "SuperBOL Studio OSS" works out of the box on Windows . No need to add a special task.json or something else. I have a small hello.cob program for testing and it works so far but watch the value variable AGE is not possible. Maybe am oversee something. Please have a look on the screenshot. Could someone help please? PS: Command which executed bei F5 is: cobc -x -ftraceall -g -fformat=auto -std=default -ext cpy -ext cbl -ext...
Sorry, you are fully right. SuperBOL-GnuCOBOL with VS Code with extension "SuperBOL Studio OSS" works out of the box on Windows . No need to add a special task.json or something else. I have a small hello.cob program for testing and it works so far but watch the value variable AGE is not possible. Maybe am oversee something. Please have a look on the screenshot. Could someone help please?
In addition to Mickey good tips: On Windows I like using the GnuCOBOL-package from SuperBOL. In this distribution GixSQL is also included. There is also an addon from SuperBOL for VS Code and VS Codium which provides a very good support for GnuCOBOL under VS Code. Maybe you could create a own file task.json for compile and run out of VS Code. Showing errors in source code is also possible with a good task.json. This solution is a good choice in my opinion. But it needs a little work to adjust settings.json...
Hi, maybe you could edit the file pg_hba.conf of the PostgreSQL server like this: # TYPE DATABASE USER ADDRESS METHOD # standard for local connections local all postgres peer # first this for database user cobol_user (local and TCP/IP) local all cobol_user md5 host all cobol_user 127.0.0.1/32 md5 host all cobol_user ::1/128 md5 [...] then all the other stuff ... And then restart the postgresql-service... This was the last missing piece for me to get a connection of my user "cobol_user" on localhost...
Maybe you could read the currency symbol from an environment variable and build an output string for display: IDENTIFICATION DIVISION. PROGRAM-ID. CURRENCY-ENV-2. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-AMOUNT PIC 9(6)V99 VALUE 9876.54. 01 WS-AMOUNT-FMT PIC Z(6)9.99. 01 WS-CURRENCY-SYMBOL PIC X(8) VALUE SPACE. 01 WS-OUTPUT-STR PIC X(40). 01 WS-ENV-VALUE PIC X(32). PROCEDURE DIVISION. *> Read currency symbol from environment ACCEPT WS-ENV-VALUE FROM ENVIRONMENT "CURRENCY" IF FUNCTION TRIM(WS-ENV-VALUE)...
Maybe you could read the currency symbol from an environment variable and build an output string for display: IDENTIFICATION DIVISION. PROGRAM-ID. CURRENCY-ENV-2. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-AMOUNT PIC 9(6)V99 VALUE 9876.54. 01 WS-AMOUNT-FMT PIC Z(6)9.99. 01 WS-CURRENCY-SYMBOL PIC X(8) VALUE SPACE. 01 WS-OUTPUT-STR PIC X(40). 01 WS-ENV-VALUE PIC X(32). PROCEDURE DIVISION. *> Read currency symbol from environment ACCEPT WS-ENV-VALUE FROM ENVIRONMENT "CURRENCY" IF FUNCTION TRIM(WS-ENV-VALUE)...
I also think it's a good idea. As a newcomer, I first used a search engine to look for a simple installation of GnuCOBOL on Windows. Arnold's website was then suggested to me. Later, I asked a chatbot, which also suggested SuperBOL... If all this information from your quickstart howto is easy to find here (for example, under Summary), then it's really helpful for newcomers :-)
I also really like the versions from Arnold and Chuck. They work really well and are very easy to use. The version from SuperBOL (https://superbol.eu/en/developers/windows-aio-32/) is also good. In my opinion, it has the advantage that GixSQL is already included in the bin directory, so you can start using embedded SQL (sqlite3, Postgresql, etc.) right away. Another option is the package from MSYS2 (pacman -S mingw-w64-ucrt-x86_64-gnucobol), if you already have MSYS2 installed. And there is also...
Thanks for the fix. It works very well. I compiled svn revision 5588 under Ubuntu 24.04 with gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 and make check and make test are both green. My buggy code now runs into good messages without a crash :-) cobc -x create-sort-crash-report-this.cob create-sort-crash-report-this.cob:24: error: 'SORT-DATEI' is not defined 22 | 05 DATEN-INHALT PIC X(50). 23 | 24 > SD SORT-DATEI. 25 | 01 SORT-SATZ. 26 | 05 SORT-SCHLUESSEL PIC X(10). create-sort-crash-report-this.cob:24:...
cobc aborts without recovering because missing file assignment
Hi Serge, probably you need the dev-package of libncurses: You could try this: sudo apt install libncurses-dev make distclean ./configure make -j$(nproc) Best regards, Michael
Hi Serge, probably you need the dev-package of libncurses: You could try this: sudo apt install libncurses-dev make clean ./configure make -j$(nproc) Best regards, Michael
Hi Serge, probably you need the dev-package of libncurses: You could try this: sudo apt install libncurses-dev ./configure make clean make -j$(nproc) Best regards, Michael
Thanks, I like merch stuff like that