It seems to me that the work around is simple.
Use the normal way of passing a parameter to and from a subroutine.
Linkage Section
01 parm1
01 parm2
Procedure division using parm1 parm2.
Encumbering Simon with a MF / IBM feature that hasn't been used by either of your combined 75 years of COBOL lacks logic.
If the intent is just to "play around" with Gnu COBOL open a bug / wish list ticket
Ralph
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree that the work around is simple, and that's what my functionABC does. But my functionABC2 was to prototype the use of returning, which looks like it doesn't work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a Professor of Computer Science Emerita and have been doing a lot of Youtube videos on Assembly language, Databases, C/C++ and am planning to start COBOL and Fortran very soon. I am putting together lesson plans/scripts for the videos, and defining/using subprograms/subroutines in one of these videos. I just wanted to get it right as I am planning on using GNUCOBOL even though IBM's COBOL on x86 is easily acquirable, but much more difficult to do so compared to GNUCOBOL. I have decided to show the two methods, and it currently works on IBM's COBOL, but how it can be worked around on GNUCOBOL since it isn't yet implemented (correctly). :-) Thanks for all of your attention to this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Those videos sound good!
Can you please upload your old and be videos to a free video sharing site, too?
If you like, we may be able to review your scripts for the COBOL videos here to get a wider view from industrial experts and compiler builders. I always find it sad when quite good videos contain "bad recommendations" or errors...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I watched the COBOL videos in parts, not all the minutes, just parts.
Interesting, a good and thorough introduction to data types. 13 parts in total. We first do a MOVE in part 9, and a PERFORM in part 13a. So there are still many, many things missing.
Part 1 deals with the installation for 50 minutes. IBM COBOL (60 days trial version) a few minutes on Linux.
And GnuCOBOL on Linux and on Windows MSYS. Unfortunately, the fastest option on Windows is not mentioned or shown. This is a typical error in all other GnuCOBOL videos on the internet. You can simply download a precompiled binary code, unzip it and that's it, the compiler runs.
The link to "Arnold's GnuCOBOL Resources (with prebuilts)" is also on this page: "GnuCOBOL Guides". It really is two clicks, 1. click download, 2. click unzip, and it's done. That's what students like today. You build it all within 50 minutes. But that only scares those interested in COBOL.
When it comes to GnuCOBOL, at least these pages should be shown to students as information:
"https://sourceforge.net/projects/gnucobol"
"https://gnucobol.sourceforge.io/guides.html"
"https://gnucobol.sourceforge.io/faq/index.html"
And in addition the "GnuCOBOL Contributions (Tools/Samples incl. Games)" is also important:
"https://sourceforge.net/p/gnucobol/contrib/HEAD/tree/trunk"
There are many examples there, both small and large. There a student can see what a real program looks like. Or, for example: how does COBOL work with an SQL database, etc...
In general, it took a lot of time to set up the development environment and the text editor "Geany". Then the "fix" COBOL format is used and the line numbers are written yourself. Later, an AWK script is created to renumber the numbers after an insert. If you are already on Windows, you could use any Windows text editor. For example, Notepad++ also has COBOL syntax highlighting. And it would be better to work with "free" COBOL format and not confuse the students. Then you can spend more time on COBOL.
There are sometimes references to C/C++ and COBOL differences in data types. That's why I assume that students who already know other programming languages will take part here. It is definitely very different if you learn the first programming language or not. Then you have to teach accordingly.
One more comment. The video is not sharp enough for me, and the code or text is not always easy to read if you don't zoom in on the text/code. Unfortunately, it often happens that when your head appears at the bottom right. But maybe I'm just too old and that's why I can't see clearly and well anymore...
So to sum it up, I'm very happy that you teach COBOL. It's rare these days. And you don't have to take my comments so seriously, keep it up!
BR
László
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Apart from the MYS2 issues in that video (one could only install mingw64 [not all 4-5 environments] and pacman -S mingw-w64-x86_64-gnucobol would install everything needed) you're right that even that is not necessary to "just use GnuCOBOL on Windows".
So... is there a good video out there that shows how to do the setup this way, including setup of the environment)? If not: does anyone volunteer? :-)
Note: the WSL2 setup should be nicer nowadays, for "more intense" development I'd definitely suggesting to have a look for that, because that environment will be commonly much faster to compile and run COBOL. And again doing sudo apt install gnucobol would install all necessary tools (as it would in Mint).
For both options you can also install VSCodium + one of the COBOL extensions, superbol works quite fine "in general", also including debugging within the IDE.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems to me that the work around is simple.
Use the normal way of passing a parameter to and from a subroutine.
Linkage Section
01 parm1
01 parm2
Procedure division using parm1 parm2.
Encumbering Simon with a MF / IBM feature that hasn't been used by either of your combined 75 years of COBOL lacks logic.
If the intent is just to "play around" with Gnu COBOL open a bug / wish list ticket
Ralph
I agree that the work around is simple, and that's what my functionABC does. But my functionABC2 was to prototype the use of returning, which looks like it doesn't work.
I am a Professor of Computer Science Emerita and have been doing a lot of Youtube videos on Assembly language, Databases, C/C++ and am planning to start COBOL and Fortran very soon. I am putting together lesson plans/scripts for the videos, and defining/using subprograms/subroutines in one of these videos. I just wanted to get it right as I am planning on using GNUCOBOL even though IBM's COBOL on x86 is easily acquirable, but much more difficult to do so compared to GNUCOBOL. I have decided to show the two methods, and it currently works on IBM's COBOL, but how it can be worked around on GNUCOBOL since it isn't yet implemented (correctly). :-) Thanks for all of your attention to this.
Those videos sound good!
Can you please upload your old and be videos to a free video sharing site, too?
If you like, we may be able to review your scripts for the COBOL videos here to get a wider view from industrial experts and compiler builders. I always find it sad when quite good videos contain "bad recommendations" or errors...
https://www.youtube.com/@billskycomputerguy
Hello,
I watched the COBOL videos in parts, not all the minutes, just parts.
Interesting, a good and thorough introduction to data types. 13 parts in total. We first do a MOVE in part 9, and a PERFORM in part 13a. So there are still many, many things missing.
Part 1 deals with the installation for 50 minutes. IBM COBOL (60 days trial version) a few minutes on Linux.
And GnuCOBOL on Linux and on Windows MSYS. Unfortunately, the fastest option on Windows is not mentioned or shown. This is a typical error in all other GnuCOBOL videos on the internet. You can simply download a precompiled binary code, unzip it and that's it, the compiler runs.
The link to "Arnold's GnuCOBOL Resources (with prebuilts)" is also on this page: "GnuCOBOL Guides". It really is two clicks, 1. click download, 2. click unzip, and it's done. That's what students like today. You build it all within 50 minutes. But that only scares those interested in COBOL.
When it comes to GnuCOBOL, at least these pages should be shown to students as information:
"https://sourceforge.net/projects/gnucobol"
"https://gnucobol.sourceforge.io/guides.html"
"https://gnucobol.sourceforge.io/faq/index.html"
And in addition the "GnuCOBOL Contributions (Tools/Samples incl. Games)" is also important:
"https://sourceforge.net/p/gnucobol/contrib/HEAD/tree/trunk"
There are many examples there, both small and large. There a student can see what a real program looks like. Or, for example: how does COBOL work with an SQL database, etc...
In general, it took a lot of time to set up the development environment and the text editor "Geany". Then the "fix" COBOL format is used and the line numbers are written yourself. Later, an AWK script is created to renumber the numbers after an insert. If you are already on Windows, you could use any Windows text editor. For example, Notepad++ also has COBOL syntax highlighting. And it would be better to work with "free" COBOL format and not confuse the students. Then you can spend more time on COBOL.
There are sometimes references to C/C++ and COBOL differences in data types. That's why I assume that students who already know other programming languages will take part here. It is definitely very different if you learn the first programming language or not. Then you have to teach accordingly.
One more comment. The video is not sharp enough for me, and the code or text is not always easy to read if you don't zoom in on the text/code. Unfortunately, it often happens that when your head appears at the bottom right. But maybe I'm just too old and that's why I can't see clearly and well anymore...
So to sum it up, I'm very happy that you teach COBOL. It's rare these days. And you don't have to take my comments so seriously, keep it up!
BR
László
Apart from the MYS2 issues in that video (one could only install mingw64 [not all 4-5 environments] and
pacman -S mingw-w64-x86_64-gnucobol
would install everything needed) you're right that even that is not necessary to "just use GnuCOBOL on Windows".Both Arnold's page (providing older and smaller Mingw32 and the MSYS2 mingw64 one repackaged) and installer from https://superbol.eu/en/gnucobol/ (current deep link https://superbol.eu/en/developers/windows-aio-3.2/ - also repackaging the MSYS2 mingw64 one, with a bit of more additional tools) are easy to use options.
So... is there a good video out there that shows how to do the setup this way, including setup of the environment)? If not: does anyone volunteer? :-)
Note: the WSL2 setup should be nicer nowadays, for "more intense" development I'd definitely suggesting to have a look for that, because that environment will be commonly much faster to compile and run COBOL. And again doing
sudo apt install gnucobol
would install all necessary tools (as it would in Mint).For both options you can also install VSCodium + one of the COBOL extensions, superbol works quite fine "in general", also including debugging within the IDE.
Adjusted source which:
program-id
andCALL
for something that has only passed parametersfunction-id
andFUNCTION XYZ()
for something that has input parameters and a return valueand by that, compiles fine without warnings on GC 2.2 and 3.2 - and also works fine in both cases:
execution result (no matter if compiled with
-debug
or not):