PDCursesMOD does provide a Windows graphic version called WINGUI. With this you should be able to access individual pixels using the setpixel function. There are some serious considerations How to Access Pixels in WinGUI To draw or manipulate individual pixels, you must bypass the curses abstraction and use the underlying Windows API: Get the Device Context (HDC): You need a handle to the window's device context to perform graphical operations. In the WinGUI port, you can often obtain the relevant...
I believe that you will be required to use the pdcurses-wingui.dll and copy it to pdcurses.dll Chuck Haatvedt
Assuming that the terminal / console is using a UTF-8 locale.... The currency symbol for the de_DE.UTF-8 (German/Germany) locale is the Euro sign (€). In UTF-8 encoding, which is standard for this locale, the € sign is represented by a 3-byte sequence. Its binary value is 0xE2 0x82 0xAC in the function to move numeric data to an edited numeric field where the PIC string contains the currency symbol $, what currency symbol would we use a the output is a single byte character string ? The de_de.UTF-8...
I am thinking about how to move numeric to a edited numeric field which is using the euro symbol as the currency symbol as it is a 3 byte length field which means the following is a variable length field in COBOL 05 SALES-AMT PIC $999.99-. The SALES-AMT field could be 8 to 11 bytes long depending on the size of the currency symbol or would we use 4 bytes for the currency symbol as UTF-8 characters can be 1 to 4 bytes in size ? Chuck Haatvedt the NUM-VAL functions would need to handle wide character...
Welcome Preston, I'm a retired mainframe COBOL programmer so I am not familiar with UTF-8. I assume that we would support all 3 variants on PIC U(n), fixed length, dynamic and byte-length. The following link provides some information about how this is handled in IBM Enterprise COBOL. https://www.ibm.com/docs/en/cobol-zos/6.3.0?topic=cobol-defining-utf-8-data-items Would edited numeric fields be required to use wide characters when the locale is UTF-8 as some currency symbols are multi-byte. This...
I think it would be better to adhere to the COBOL standard, which GnuCOBOL and MF COBOL are not doing now. However I would defer to Simon on this. From a more pragmatic view, it is possible to accomplish what you want to do now, it does require more work by the programmer... On the other hand, the CBL_GC_WINDOW function does allow the programmer to create multiple windows each with its own default foreground and background colors. Personally my goal was and remains to provide more functionality to...
Eugenio, do you have access to the Visual COBOL Personal Edition ? https://www.rocketsoftware.com/en-us/products/cobol/visual-cobol-personal-edition/free-download This is the current version of the Micro Focus COBOL compiler. It generates the same results as my build of GnuCOBOL. That being the case, I do not see any compelling reason to modify the compiler. Chuck H.
As to the use of "extended colors", remember that these are treated differently depending upon the COBOL compiler.
As to the use of "extended colors", remember that these are treated differently depending upon the CURSES implementation.
Currently there is not a method that I am aware of in GNUCOBOL to change the default colors for stdscr(), however that could be implemented. Note that this would change the colors for the entire screen, not just the area affected by the ERASE clause. from deepwiki does that behavior follow the cobol standard ? The ERASE clause behavior in GnuCOBOL does not strictly follow the COBOL standard - it's an implementation-specific behavior that follows curses library conventions. Standard vs Implementation...
According to the latest standard the ERASE clause states the screen is "cleared". It says nothing about changing the color. Since the default color if not using the multiple windows functions, is white foreground / black background. It would seem like ACUCOBOL-GT is probably matching the standard. MF COBOL and GNUCOBOL would appear to be incorrect. So the question is should GnuCOBOL follow the standard OR should it follow MF Visual COBOL. ISO/IEC 1989:20xx FCD 1.0 (E) ERASE clause 13.18.20 ERASE...
This would appear to be different from the Micro Focus COBOL documentation for the ERASE clause https://docs.rocketsoftware.com/bundle/visualcoboldevhub_ug_110/page/yhg1742953039858.html Also different from the CURSES implementation of the clear to eol / clear to bot which appears to match the MF COBOL implementation https://github.com/Bill-Gray/PDCursesMod/blob/master/docs/MANUAL.md We should determine whether we want to duplicate the MF COBOL behavior or implement a GnuCOBOL specific behavior....
This would appear to be different from the Micro Focus COBOL documentation for the ERASE clause https://docs.rocketsoftware.com/bundle/visualcoboldevhub_ug_110/page/yhg1742953039858.html Also different from the CURSES implementation of the clear to eol / clear to bot which appears to match the MF COBOL implementation https://github.com/Bill-Gray/PDCursesMod/blob/master/docs/MANUAL.md We should determine whether we want to duplicate the MF COBOL behavior or implement a GnuCOBOL specific behavior....
This would appear to be different from the Micro Focus COBOL documentation for the ERASE clause https://docs.rocketsoftware.com/bundle/visualcoboldevhub_ug_110/page/yhg1742953039858.html Also different from the CURSES implementation of the clear to eol / clear to bot which appears to match the MF COBOL implementation https://github.com/Bill-Gray/PDCursesMod/blob/master/docs/MANUAL.md We should determine whether we want to duplicate the MF COBOL behavior or implement a GnuCOBOL specific behavior....
I don't think that this is a bug, note that the "not on exception is not part of the following statement. This is an end of scope scenario. Find the end of scope on each of the statements in your program. This is a good example of coding a "." at the end of each independent code statement would have resolved the issue. display '02 ... 1234567890' AT 1202 BACKGROUND-COLOR 6 FOREGROUND-COLOR 1 it is part of this statement display 'EXCEPTION 2' AT 1402 For example.... Note that I added a period (hard...
Simon, Alphanumeric data defined as PIC X can exist in other data structures than just text files & terminals. Consider an array of elements which contain alphanumeric fields. If these fields are to contain a specific number of characters, that presents a challenge in how to make the fields fixed in length for them to exist in an array element. I suspect that it may be more complicated in that any PIC X (alphanumeric field) could contain UTF-8 data. At which point the size of a field would not define...
from deepwiki.com what changes would be needed to the codegen process to support the cobol code as written ? Fast To support the COBOL Report Writer LINE OCCURS ... VARYING ... VARYING ... as written, codegen needs to iterate the parsed report_vary_list and emit nested C loops at GENERATE time, while integrating with existing report field emission and runtime initialization. Here’s what’s required and where to make the changes. High-level required changes Emit nested C loops for each VARYING variable...
the following example is from the IBM Report Writer PDF at the following link https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://publibfp.dhe.ibm.com/epubs/pdf/c2643014.pdf&ved=2ahUKEwihodnjosiSAxUBj4kEHUz9NakQFnoECB8QAQ&usg=AOvVaw1MZ0sDCBqmg-zXr7vQSeoq According to deepwiki.com gnucobol does not currently support varying in the report section. Deepwiki does suggest changes to support this program but I'm not sure if this would meet Vince's needs. IDENTIFICATION DIVISION. PROGRAM-ID....
The attempt to capture the physical "Alt + Delete" key combination, which is generally not directly supported by the base ncurses library in a terminal-independent manner. The ALT_DEL key is mapped and supported by PDCURSESMOD on Windows, However it is not supported by NCURSES. In screenio.c the following is mapped if GNUCOBOL is built with -DCOB_NEW_KEY. As to "multi-byte" characters these are not supported directly by NCURSES. I suspect that even the characters defined below may be dependent upon...
Simon / Juan Carlos, I suspect that the issue that Juan Carlos is encountering is that his code base contains code based on non-standard vendor extensions to COBOL. This is an on going issue with vendor extensions to the "COBOL standards". By definition that should mean that the use of those vendor extensions to the COBOL language / grammar are NOT portable across COBOL compiler vendors. I would assume that compiler vendors are free to decide which extensions they wish to support. So it can not be...
Vince have you tried using something like the following Method 2: Single Detail Line with Loop Use a single detail line definition and loop through subscripts: 01 DEPT-TOTAL TYPE DETAIL LINE PLUS 2. 03 COLUMN 05 PIC 9(02) SOURCE DE-NUMBER (SUB-IX). 03 COLUMN 08 PIC X(15) SOURCE DE-NAME (SUB-IX). 03 COLUMN 38 PIC $$,$$9.99 SOURCE DE-GROSS (SUB-IX). Then in procedure division: PERFORM VARYING SUB-IX FROM 1 BY 1 UNTIL SUB-IX > MAX-DEPTS GENERATE DEPT-TOTAL END-PERFORM ps... I got this suggestion form...
Juan Carlos, some of the benefits of a package like Faircom RTG would be potentially no COBOL code changes as it would be a simple recompile using the external file handler via a -fcallfh parm on the compile. they have a utility which can read MF indexed files and convert them to Faircom files without going thru an unload reload process provided you have a MF license when doing the conversion. The Faircom DB underlying their RTG product has undergone significant ACID testing / verification. You could...
Juan Carlos, it should be pretty simple to create an external file handler using dynamic sql access the tables which replace the indexed files. Using DB2 this would be pretty simple, using Postgres this may not be too difficult assuming that you can code a simple select which would return all the columns on a row for each table. Secondary indexes with duplicates may be an issue to reproduce the same order when reading sequentially or random as i don't think that indexed guarantee a specific order...
Juan Carlos, I would not consider myself to have any more that a very basic level of understanding as it pertains to the GnuCOBOL compiler architecture. I very much agree with your above assessment. At my current stage of life, I am not interested in a "job" but rather a hobby. Something I do because I enjoy it. If I had to rank the tasks associated with my time as a paid employee, from best to worst, documentation would be at the bottom of the list. I do enjoy mentoring and I should mention that...
Mark, I have some experience with Fujitsu COBOL. However the person I would consider to have expertise with Fujitsu COBOL is Ralph Linkletter and he does participate on these forums. If you would like some hands on assistance, you can contact me on Microsoft Teams, you can contact me there at chaatvedt1@outlook.com if that does not work for you, please post some of the build errors you are encountering and I will take a look at them. Thanks Chuck Haatvedt
Juan Carlos, There are companies, two that I am aware of that provide commercial support for GnuCOBOL. They may be willing / interested in making enhancements to GnuCOBOL. I have no idea what the would charge for that, it is something that could be explored. For volunteers it is a bit different, we are all different and have different reasons and goals when contributing our time and effort. Also we have different skillsets which would impact the type of enhancements that we could undertake. The time...
Juan, l asked you for a list of issues that you are having with Gnucobol. I am still waiting for your response. I have done considerable work on the screen processing, I recently completed coding & testing of XML PARSE with XMLSS support. I have also successfully built GNUCOBOL with VISAM-2.2. Recently I have been working with Faircom RTG to implement support for transaction processing with COMMIT and ROLLBACK support using the GNUCOBOL compiler. The Faircom RTG is a commercial client server database...
the issue with the PARSELEX.C program has been identified and resolved. It was caused by using a local variable in a C function which had not been initialized. It has been fixed and tested successfully. compiling without any debug and the production level optimization it generates a more comparable size module F:\AA-minGW32-static\bruce>gcc -O2 -std=c11 -march=native -mtune=native -g0 -Wdeclaration-after-statement -c parselex.c F:\AA-minGW32-static\bruce>gcc -o parselex.dll parselex.o -s -shared...
To add a new ALTERNATE RECORD KEY to an existing GnuCOBOL Berkeley DB file, you cannot simply change the SELECT clause in your COBOL program and re-run it. Indexed files in GnuCOBOL/Berkeley DB require the keys to be defined at the time the file is created. Adding a new key to an existing file requires a specific procedure involving creating a new file and migrating the data. you would need to consult the Berkeley DB documentation and the underlying GNUCOBOL implementation of the COBOL OPEN of a...
Juan, could you please contact me via a private message so that we can establish a direct email communication ?
Juan, If you are using a terminal which supports ISO-8859-15 then entering Latin-1 characters should not be an issue. Could you please test this and report back as to whether this resolves the issue with accented characters ? PANELS... mywin does not always point to stdscr, it points the the window associated with the top panel. The standard SCREEN SECTION should work with PANELS, however you need to make sure that the SCREEN SECTION definition matches that of the window which is in focus. Again...
Anshul, I don't think that will help with variables in your COBOL code as GNUCOBOL does not appear to have any compiler option to not optimize storage. Some of the other compiler vendors have an option like this. Also the default GNUCOBOL compiler behavior is to initialize all of working storage, So that would defeat an storage optimization of unused storage by the C compiler, so they are being optimized by the GNUCOBOL compiler. You can prove that by compiling your program with the "-save-temps"...
Anshul, I don't think that will help with variables in your COBOL code as GNUCOBOL does not appear to have any compiler option to not optimize storage. Some of the other compiler vendors have an option like this. The option I gave you to include a C header file does work. Could you post the contents of your "compilation.h" header file ? Chuck Haatvedt
you need to add -A "-include your-header.h" cobc -x T1.cbl -A "-include compilation.h" -o T1.so give that a try... Chuck Haatvedt
you need to add -A "-include your-header.h" cobc -x T1.cbl -A "-include compilation.h" -o T1.so give that a try... Chuck Haatvedt
Eugenio, It will need to be updated. Currently Simon is working to implement this functionality as it is not yet in the current dev builds. Chuck Haatvedt
Here is a link to my dropbox folder CURRENCY which contains the Windows binaries plus the TARBALL of this BETA build of GNUCOBOL. It is not a completed effort at this point but if you wish to kick the tires so to speak, give it a try and report your feedback here. https://www.dropbox.com/scl/fo/zdt7skujwuluh0lt4u3lz/ACoOVySKnZE0Q-1qdt3Fbi0?rlkey=hlqpqld8yl655tln5zyk9tz13&st=82sflb10&dl=0 Chuck Haatvedt
per AI... Changing the locale specifically for a command console session in Windows 11 without affecting the system locale or using PowerShell is not directly possible through a simple command. The locale settings in Windows are generally system-wide or user-specific, and the traditional cmd.exe environment does not provide a built-in command to temporarily modify these settings for a single session. While you can change the system locale through the Settings app or modify user-specific language...
I have some preliminary results as follows, note that this is using my local beta version of the GNUCOBOL compiler which I have not published as of yet. Waiting for feeback and consultation with Simon. disregard the use of "cobcd" as that is using the cbl-gdb debugging extension F:\AA-minGW32-static\CURRENCY>cobcd -x testcomma.cbl -O0 F:\AA-minGW32-static\CURRENCY>testcomma USING US LOCALE AND CODE PAGE +1234567.89 + $1,234,567.89 $ +1,234,567.89 + $1,234,567.89 $ +1,234,567.89 AFTER SETTING LOCALE...
Eugenio, Another consideration is the Source Code Management system. If you are in a mainframe environment, even though the Enterprise COBOL compiler may support free format, you need to use a format supported by the Source Code Management system your organization uses. These Source Code Management systems may have been in use for decades, so the organization may not have made the changes to support variable length source code. That type of change would most likely involve considerable cost which...
Everyone, I have created a small C program to demonstrate the numeric / monetary strings returned from the locale. So they will only be used if the following runtime.cfg options are set to true. # Environment name: COB_USE_LOCALE_NUMERIC # Parameter name: use_locale_numeric # Purpose: Should the numeric locale be used to for # numeric separator and decimal point # Type: boolean # Default: false # Example: COB_USE_LOCALE_NUMERIC: TRUE # Environment name: COB_USE_LOCALE_MONETARY # Parameter name: use_locale_monetary...
Everyone, the scope of this effort is limited to how the GNUCOBOL compiler creates an "editted numeric" field. The standard is the the length of the field matches the PICTURE clause. So the substitution of the $ in the PICTURE clause MUST be a single character. The goal of this effort is to provide a runtime OPTION to allow the compiler to use the NLS functionality for the numeric / monetary formatting of editted numeric fields. Both Linux and Windows provide support for National Language Support...
I am working to add support for using the first character of the currency string from the locale depending on the setting of a runtime configuration / environment variable. Updates will be provided as I work towards having something available for beta testing. The changes are more complex than I initially thought they would be. Chuck Haatvedt
This may be possible in that currency symbol / decimal point and thousands separator are defined at the module level if my memory is correct. We could have a runtime configurable setting which would cause these values to be extracted from the locale and used throughout the gnucobol program. #define _LCONV_DEFINED struct lconv { char *decimal_point; char *thousands_sep; char *grouping; char *int_curr_symbol; char *currency_symbol; char *mon_decimal_point; char *mon_thousands_sep; char *mon_grouping;...
Vince, to understand your requirements a bit better, are you looking for a method to change the currency symbol at runtime without changes to the code. If so this may be possible by setting the locale before execution. it may be possible to create a CBL_SET_CURRENCY_SYMBOL routine which could access the locale and extract the currency symbol and then set the COBOL currency symbol to that value. here is an example of this ... let me know if this is something you would be interested in exploring more...
Mickey / Simon, my most recent builds as well as the tarball are build on top of the current SVN 3.3 source code as of Oct 19, 2025 with the following changes added. Also they contain the most current source for PDCURSESMOD, GCSORT and CBL-GDB. ++ cp -fp /F/AA-minGW32-static/gcwindow-new.cpy copy/gcwindow.cpy ==> this is just a personal preference of mine with conditional CDF variable checks commented out. ++ cp -fp /F/AA-minGW32-static/run_manual_screen.at tests/testsuite.src/run_manual_screen.at...
Gregory, it appears that the output file is app-libs.dll and you are also telling the linker "ld" to load that file as input as well. The error "file not recognized: File truncated" when using GCC and LD on Windows 10 typically indicates an issue with file integrity or how the compiler and linker are handling output files. This error can arise from several scenarios: 1. Input and Output File Conflicts: Writing to the same file being read: This occurs when the output file of a compilation or linking...
Updated the download files in top post in this thread. This version includes support of the EXCEPTION event. Chuck Haatvedt
Gregory, the build that Arnold has is GNUCOBOL 3.2 the release version. The version which you downloaded from my link is built from the current source plus some of my most recent additions. There were also many changes done to GNUCOBOL since the 3.2 release. So I am not sure if the more recent GCC compiler was the cause of the resolution or changes to GNUCOBOL itself. In any event, since the issue is resolved, perhaps we should continue on the path of improving the latest build of GNUCOBOL, just...
Anshul / Mark using the above technique, you could create a process which would generate a "compilation.h" file with any version control information you prefer and then use the above technique to include it in your compile commands. If you need some help with this please post here and I can try to help. Chuck Haatvedt
Anshul, this is an option that may work for you which does not require any changes to the existing compiler. first create a C header file in and store it it the location of your choice... Note that you can add customizations of your choice. Note that the header that you build will include GCC macros which will be automatically expanded by GCC during the compilation. const char *build_date = "compile date is " __DATE__; const char *build_time = "compile time is " __TIME__; const char *build_info =...
I confirmed that this works on Windows using the most recent GNUCOBOL compiler build. Note that this is independent of the GNUCOBOL compiler so it should work with any version build with GCC. Other C compiler may have the same built in macros or something similar.. I have attached by header file cobc -x cobtst.cbl -x -A "-include compilation.h" also I have attached a screen print with show the **compile strings in the executable file. Chuck Haatvedt
I confirmed that this works on Windows using the most recent GNUCOBOL compiler build. Note that this is independent of the GNUCOBOL compiler so it should work with any version build with GCC. Other C compiler may have the same built in macros or something similar.. I have attached by header file cobc -x cobtst.cbl -x -A "-include compilation.h" also I have attached a screen print with show the **compile strings in the executable file. Chuck Haatvedt
Ahshul, this is an option that may work for you which does not require any changes to the existing compiler. first create a C header file in and store it it the location of your choice... Note that you can add customizations of your choice. Note that the header that you build will include GCC macros which will be automatically expanded by GCC during the compilation. const char *build_date = "compile date is " __DATE__; const char *build_time = "compile time is " __TIME__; const char *build_info =...
Sorry Ahshul, I found this after posting and removed my post but you saw it before I could delete it. Perhaps a change request to Simon to add the NOSTGOPT which Micro Focus COBOL has would be worthwhile. I believe that IBM Enterprise COBOL has a similar function compiler option.
Gregory, try the color set to 7 and see if that creates white I will not be able to do any debugging / analysis until I get back home to my dev environment.... sorry about that. Chuck Haatvedt
Gregory, try the color set to 7 and see if that creates white Chuck Haatvedt
Gregory, if you just want to use COBOL functions to access the screen then you would just compile the colors-new.cbl as follows.... note the -lpdcurses phrase is needed for the link step C:\data\SPFSE>cobc -x colors-new.cbl -lpdcurses -v cobc (branches/gnucobol-3.x r5575M) 3.3-dev.5575 Built Aug 31 2025 14:57:21 Packaged Jul 30 2025 18:42:59 UTC C version (MinGW) "15.2.0" loading standard configuration file 'default.conf' command line: cobc -x -lpdcurses -v colors-new.cbl preprocessing: colors-new.cbl...
Gregory, I'm on vacation now so I don't have access to my development computer. See the attached colors-new.cbl program for an example of how to create a window and you can set the foreground / background when you create the window. I will be traveling for the next few weeks and should be home by mid October, before that my access will be limited as I'm driving. I have found that WINGUI is much better that WINCON when using PDCursesMOD (which is what I use in my build process). ps... in the bin folder...
Gregory, I'm on vacation now so I don't have access to my development computer. See the attached colors-new.cbl program for an example of how to create a window and you can set the foreground / background when you create the window. I will be traveling for the next few weeks and should be home by mid October, before that my access will be limited as I'm driving. Chuck Haatvedt
The binaries that I provide for Windows are the most current builds and should include every thing you need to port your Linux GNUCOBOL code to run on Windows. If you use any libraries not included in GNUCOBOL itself, let us know here and we will try to assist you to get them running on Windows. Some Linux system functions can be difficult to implement on Windows, before worrying too much about that let's see what we are looking at. You can always contact me directly via Private Message and I will...
Sauro has created test programs which show how to use GCSORT to create E15 / E35 sort exit programs. See the following link to his contribution folder... https://sourceforge.net/p/gnucobol/contrib/HEAD/tree/trunk/tools/GCSORT/tests/testcase_exitroutine/ Chuck Haatvedt
Gregory, I use MSYS2 to build the GNUCOBOL compiler, GCSORT, CBL-GDB, PDCURSESMOD and BERKELEY DB 18.40 for Windows 10 or 11. I build both the 32 and 64 bit versions of these. These contain a number of enhancements which I have made to support multiple TUI window support as well as direct screen access via MF / Fujitsu CBL callable functions. The following is a link to my DropBox folder which includes 7z archive files for the Windows binaries as well as a tarball for building on Linux. As you are...
Ben, I would recommend looking into using GCSORT. I have built both the 32 and 64 bit version in the Windows binaries that have published in my DropBox area. Sauro Menna does provide source code and build instructions for building on Linux. I seem to recall that it does support E15 and E35 sort exit programs in GNUCOBOL as well. Using the Windows 64 bit compiler, I was able to sort a 10 GB file using the ALLOCATE verb and an indirection file containing the sort keys. If you are interested in that...
Ralph, does this environment variable COB_VARSEQ_FORMAT resolve the issue as it would seem to match the ZOS RDW. 10.2.3.4 File I/O Environment name: COB_VARSEQ_FORMAT Parameter name: varseq_format Purpose: Declare format used for variable length sequential files - different types and lengths precede each record - ’length’ is the data length, does not include the prefix Type: 0 means 2 byte record length (big-endian) + 2 NULs 1 means 4 byte record length (big-endian) 2 means 4 byte record length (local...
Ralph, the error is any DISPLAY VERB which attempts to display an XML special register which contains text as the -fec=all generates the following /* Line: 72 : DISPLAY : xmlsmpl-3.cbl */ line 72 "xmlsmpl-3.cbl" module->statement = STMT_DISPLAY; line 397 "xmlsmpl-3.c" module->module_stmt = 0x00100048; cob_check_based (b_14, "'XML-TEXT'"); <<<==== causes error cob_display (0, 1, 2, &c_14, &f_14); } So this is something that Simon will need to fix in the codegen portion of COBC. Chuck Haatvedt.
I modified the tarball to fix the libcob/mlio.c so if you grab the most recent tarball that should already be fixed. Chuck Haatvedt
Mickey, my level of Linux knowledge is most likely much lower than yours. Initially the gnucobol make step failed with a not found message from the linker. I did a search found the library it reported as not found. Then I researched how to add it to the gcc parms, That was how I found out about LDFLAGS='-L/usr/local/lib64'. After that i reran the configure did a make and it worked. Then at execution of cobcrun it failed attempting to load a shared module,, again i did a search for the not found module...
Simon / Mickey, the issue with sax2.h is that Linux is case sensitive whereas Windows is not. I modified the mlio.c file to change the include to SAX2.h the tarball file was recreated and updated in dropbox folder link above. I have an OpenSuse SLOWROLL VM that I was able to succesfully install the gnucobol tarball. However I first had to build libxml2-2.14.5 from source as follows... 753 cd build 754 wget https://download.gnome.org/sources/libxml2/2.14/libxml2-2.14.5.tar.xz 755 tar -xf libxml*.xz...
Simon / Mickey, the issue with sax2.h is that Linux is case sensitive whereas Windows is not. I modified the mlio.c file to change the include to SAX2.h the tarball file was recreated and updated in dropbox folder link above. I have an OpenSuse SLOWROLL VM that I was able to succesfully install the gnucobol tarball. However I first had to build libxml2-2.14.2 from source as follows... 753 cd build 754 wget https://download.gnome.org/sources/libxml2/2.14/libxml2-2.14.5.tar.xz 755 tar -xf libxml*.xz...
Mickey, for Linux you will need to have libxml2 installed with the following version or higher... Note these are the versions installed on my MSYS2 build environment mingw-w64-i686-libxml2 2.14.5-2 mingw-w64-x86_64-libxml2 2.14.5-2 So libxml2 version 2.14.5 hopefully Simon can step in and give more guidance. Chuck Haatvedt
We now have GNUCOBOL XML PARSE updated and the output when parsing a complex XML file is identical to output from MF Visual COBOL Personal Edition. The link to download the Windows binaries as well as the tarball for building in Linux is below. It also includes a number of sample XML files for testing as well as a COBOL program XMLSMPL-3.CBL which I used for testing validation as the same program source will compile with the MF compiler above and the included GNUCOBOL compiler. WARNING -> this is...
Eugenio, The GNUCOBOL runtime keeps track of the cursor position internally. It uses that position to affect the behavior of the ACCEPT and DISPLAY verbs. If you use the CBL_SET_CSR_POS function to move the cursor, the GNUCOBOL runtime does not know about this, so the behavior that the programmer may be expecting could be different based on the runtime not being aware of the cursor position having been changed. Think of the screen section and using the ACCEPT verb to navigate between input fields....
Mickey, my builds usually contain all the fixes / modifications that I have been working on... So this build includes the following Multiple Window Support CANCEL verb improvements to support non-GNUCOBOL modules. Call with Exception Check to CANCEL programs invoked after call with exception check DIVIDE BY ZERO if run time exception condition is enabled at compile time. SCREENIO.C changes to support the new CBL direct screen functions XML improvements So the two errors in checkall are related to...
Thanks to Simon for creating the foundation for XML PARSE support. I have been working to refine the code to support parsing a "chunk" of xml one record at a time. See the XMLSMPL-3 code in the download folder to use for testing XML PARSE using a file as input. Note that the XML PARSE handler will return the event "END-OF-INPUT" when it has completed parsing the record from the file. Then read the next record, move it to the parse area and set the XML-CODE to 1 so that it will continue and parse...
Eugenio, I have fixed CBL_CLEAR_SCR and uploaded to the dropbox link. Let me know if this fixes the issue Chuck Haatvedt
Eugenio, the cbl_routines.c file in my dropbox folder has been updated to remove the "first time" logic which clears the screen. download it from the link below and then build the DLL again as follows cobc -m cbl_routines.c -lpdcurses https://www.dropbox.com/scl/fo/5tqte43y4la2938wlh2ym/AOgv4GQkaJh5g2mCmVxy0DU?rlkey=dcutci4w1i30xevaqhvcp4c45&st=f6lne3e8&dl=0 if you encounter any issues, please post them. Thanks Chuck Haatvedt
Eugenio, for both MF and Fujitsu COBOL, the attributes are a single 1 byte field. However the bits have different meanings. for example MOVE X'0F' TO ATTRIBUTE-BYTE.
Hello Eugenio, I have removed the clear screen functionality from the "first time" logic so that any call to the CBL_READ_SCR_ or CBL_WRITE_SCR_ functions will not clear the screen. As you may be aware of the MicroFocus and Fujitsu COBOL compilers have slightly different implementations, MF uses 1 byte line and column and Fujitsu uses 2 byte variables. The other significant difference is that they define the ATTRIBUTE behavior differently as well. All of the CBL_READ_SCR and CBL_WRITE_SCR functions...
Eugenio, you are correct, the first invocation of any of the CBL functions included in the direct screen access program will set up a number of data areas required by the functions and clear the screen. That was part of the original design when this was originally written from use with Ralph's WINCOBOL project. A solution to this would be to add a CALL CBL_CLEAR_SCR immediately after the CALL CBL_ROUTINES before you do any DISPLAY verbs. That functionality could easily be removed. The original intent...
The dropbox link has been updated to include the recent updates from Simon which provide for the first release of XML PARSE implementation. Note that it is not complete yet, but we need people to start testing it. As changes are made to improve XML PARSE, I will upload new binaries and a tarball. Chuck Haatvedt
This may be resolved already, could you repeat the testing with a current build of the compiler ? fixed [bugs:#999] ACCEPT with TIMEOUT issue when looping thru the verb
Something to consider is that by using a 1 byte attribute, this limits the scope of what CURSES is capable of. Simon and I have had some preliminary discussion about possibly adding a GNUCOBOL specific extension which would use something like a 4 byte attribute which would give access to the full set of CURSES attributes and 256 colors. The current architecture would enable this functionality pretty easily. Note that not all build configurations of CURSES support all of the attributes. CHTYPE 64...
Eugenio, I did find a bug in the CBL_READ_SCR functionality where it was not returning the attributes correctly. Please download the CBL_ROUTINES.C file again and recompile it to rebuild the DLL I modified your code slightly to add two DISPLAY upon SYSERR to confirm that the attributes were being read correctly. >>SOURCE FREE IDENTIFICATION DIVISION. PROGRAM-ID. TESTCHUCK01. DATA DIVISION. WORKING-STORAGE SECTION. 01 wScrPos. 03 wScrRow PIC 9(02) COMP-X VALUE 4. *> Row 0 (top of screen) 03 wScrCol...
Eugenio, I did find a bug in the CBL_READ_SCR functionality where it was not returning the attributes correctly. Please download the CBL_ROUTINES.C file again and recompile it to rebuild the DLL I modified your code slightly to add two DISPLAY upon SYSERR to confirm that the attributes were being read correctly. >>SOURCE FREE IDENTIFICATION DIVISION. PROGRAM-ID. TESTCHUCK01. DATA DIVISION. WORKING-STORAGE SECTION. 01 wScrPos. 03 wScrRow PIC 9(02) COMP-X VALUE 4. *> Row 0 (top of screen) 03 wScrCol...
Eugenio, on windows use all lower case... only LINUX requires the file name in upper case as it is case sensitive... on Windows this should work cobc -m cbl_routines.c -lpdcurses Sorry about the confusion... Chuck Haatvedt
Eugenio, the SET_X32 / SET_X64 cmd files are examples I use to set my GNUCOBOL environment from my working directory. I have multiple GNUCOBOL compilers installed on my computer. So I have multiple SET_xxxx command files set up for the different compilers. If you wanted to, you could use it as a template to create your own version. Chuck Haatvedt
Eugenio, I forget that the GCC compiler is case sensitive for determining the language of the input source file. The uppercase C in the file extension caused it to use the C++ compiler. The "-A" passes parms to the C compiler, the "-x c" tells the GCC compiler that the source language is C and not C++ cobc -m CBL_ROUTINES.C -lpdcurses -A "-x c" here is the result from my test environment. F:\AA-minGW32-static\zedit>cobc -m CBL_ROUTINES.C -lpdcurses CBL_ROUTINES.C: In function 'int generic_screen_io(void*,...
Eugenio, the call to "CBL_ROUTINES" is only used to load the DLL into memory. You can remove that call if you set up COB_LIBRARY_PATH and COB_PRELOAD in your environment. Chuck Haatvedt
Eugenio, here is an example... DISPLAY ' ' AT 0101 MOVE 25 TO TERM-ROWS MOVE 80 TO TERM-COLS CALL "CBL_GC_SET_SCR_SIZE" USING TERM-ROWS TERM-COLS CALL 'CBL_ROUTINES' CALL 'CBL_CREATE_SCR' CALL 'CBL_CLEAR_SCR' USING CLS-HEX20 CLS-HEX0F Chuck Haatvedt
Eugenio, here is a snippet of code generated by AI, it would be interesting to ask a LLM to create a COBOL program using these screen routines. WORKING-STORAGE SECTION. 01 screen-position. 03 screen-row PIC 9(2) COMP-X VALUE 0. *> Row 0 (top of screen) 03 screen-col PIC 9(2) COMP-X VALUE 0. *> Column 0 (left of screen) 01 string-length PIC 9(4) COMP-X VALUE 80. *> Length of the string to write 01 character-buffer PIC X(80). *> Buffer for characters 01 attribute-buffer PIC X(80). *> Buffer for attributes...
Hello Eugenio, I should have been more thorough in my instructions. First I built APANEL.EXE on Windows 10 using the 32 bit version of the GNUCOBOL compiler. Steps to execute APANEL on Windows. First install the 32 bit version of GNUCOBOL from my dropbox. Copy the APANEL.EXE to a work directory of your choice. Set the GNUCOBOL environment up using set_env.cmd (verify by running cobcrun --info) Create the CBL_ROUTINES.DLL using the following cobc -m COBOL_ROUTINES.C -lpdcurses (create it is the same...
Hello Eugenio, I should have been more thorough in my instructions. First I built APANEL.EXE on Windows 10 using the 32 bit version of the GNUCOBOL compiler. Steps to execute APANEL on Windows. First install the 32 bit version of GNUCOBOL from my dropbox. Copy the APANEL.EXE to a work directory of your choice. Set the GNUCOBOL environment up using set_env.cmd (verify by running cobcrun --info) Create the CBL_ROUTINES.DLL using the following cobc -m COBOL_ROUTINES.C -lpdcurses then you can execute...
I have implemented the following CBL_ Screen Routines as the MicroFocus and Fujitsu COBOL compilers have done. COB_EXT_EXPORT void CBL_ROUTINES(); COB_EXT_EXPORT int CBL_CREATE_SCR(); COB_EXT_EXPORT int CBL_CLEAR_SCR(void *a, void *b); COB_EXT_EXPORT int CBL_WRITE_SCR_CHARS(void *a, void *b, void *c); COB_EXT_EXPORT int CBL_WRITE_SCR_ATTRS(void *a, void *b, void *c); COB_EXT_EXPORT int CBL_WRITE_SCR_CHARS_ATTR(void *a, void *b, void *c, void *d); COB_EXT_EXPORT int CBL_WRITE_SCR_CHATTRS(void *a,...
I would offer a different opinion, I would prefer that GCSORT follow the restrictions enforced by IBM / SYNCSORT / MICROFOCUS and not allow SUM FIELDS to overlap other fields. Chuck Haatvedt
Yes, that would most likely resolve the issue with this particular sort. However the the underlying issue still remains. I think that a change to GCSORT is required so as to enforce the same restrictions as IBM's DFSORT product. Summing Fields (SUM FIELDS): Restrictions: SUM fields cannot overlap sort fields. They also cannot overlap each other. Numeric: SUM fields must be numeric (e.g., packed decimal, binary) Chuck Haatvedt
https://www.microfocus.com/documentation/visual-cobol/vc70/CSWin/GUID-B0376D88-A474-4193-8941-8027823B4448.html
In my opinion, it should report this condition as an error when editing the sort control cards. If the goal is for GCSORT to behave similar to mainframe sort utilities, then the above should be done. Chuck Haatvedt
Sauro, I don't think that this should be allowed. Logically how would you do a merge on intermediate / temporary files if the key fields are being changed during the merge operation. The IBM DFSORT product does not allow this. In DFSORT, overlapping sort fields are generally allowed, but there are restrictions on SUM fields and their interaction with sort fields. SUM fields cannot overlap sort fields, nor can they overlap each other. Additionally, SUM fields must be numeric and the resulting sums...