[Info-vax] VMS Cobol - GnuCOBOL

Neil Rieck n.rieck at bell.net
Sat Feb 25 07:00:48 EST 2023


On Friday, February 24, 2023 at 12:28:26 PM UTC-5, Denys Beauchemin wrote:
> On Friday, February 24, 2023 at 8:05:33 AM UTC-6, Arne Vajhøj wrote: 
> > On 2/23/2023 6:43 PM, Arne Vajhøj wrote: 
> > > And C# is not like C at all. Besides using curly braces and 
> > > having the 3 arg for loop then I do not see much similarity. 
> > > 
> > > Just compare the hello worlds: 
> > > 
> > > #include<stdio.h> 
> > > 
> > > int main() 
> > > { 
> > > printf("Hello world!\n"); 
> > > return 0; 
> > > } 
> > > 
> > > VS: 
> > > 
> > > using System; 
> > > 
> > > public class HelloWorld 
> > > { 
> > > public static void Main(string[] args) 
> > > { 
> > > Console.WriteLine("Hello world!"); 
> > > } 
> > > } 
> > > 
> > > (C# pre-V9.0) 
> > And in case someone wonder if C# 9.0 broke hello world. 
> > 
> > The above hello world still compiles and run fine with 
> > C# 9.0 and later. 
> > 
> > But it can be written as: 
> > 
> > using System; 
> > 
> > Console.WriteLine("Hello world!"); 
> > 
> > :-) 
> > 
> > Arne
> Maybe it's just me but if we are now arguing about the definition of C, C++, C#, C- and Cigar, we are no longer focused on migrating a COBOL application. 
> 
> This makes my case, that converting COBOL to C (any C) for the purposes of a migration is a bad idea for anything beyond an intellectual exercise.

Agreed but let me add a few more thoughts.

I first used COBOL on an HP-3000 more than 40-years ago and would like to remind everyone here that a COBOL compiler license was always very expensive. Heck, some companies like IBM hung their reputations on being able to run COBOL programs -AND- that their compilers produced the largest amount of executable binary which is backwards from the way we think today. IIRC, full ISAM support was an optional purchase on all PDP-11 operating systems from DEC, but then DEC decided to bundle it with VMS primarily to support the never released COBOL-80 standard (later appeared as COBOL-85).

comment: ISAM was important elsewhere on VMS including the fact that SYSUAF.DAT was indexed

I've only been working with Linux since 2016 but have been surprised about the quantity of good quality software in that eco-system which can be obtained for free. Anyone who has ever used gcc (gnu compiler collection) knows what I am typing about. This tool can generate C11 by the way.

(CAVEAT: the down side of opensource is that if you discover a bug, it may take years to get it fixed. In some instances you are better off fixing the problem yourself then submitting the solution to the authors. This has happened to me more times than one would think. This happened to me last week with the python SOAP library known as zeep)

Anyway, until Arne published this article, I did not know about GnuCOBOL so I used the yum/dnf tool on one of my Rocky Linux systems to install a copy. It worked like a charm -AND- appears to contain a number gnu-specific extensions which can be enabled-disabled by command line switches (same as what you might see with gcc). Since I've been out of the COBOL game for a long while, I grabbed some old example programs which demo ISAM file creation. They worked like a charm as well (not sure if the ISAM support is built into GnuCOBOL or is dependent upon some already-installed system library). But this has been a very pleasurable nerdish adventure for me which cost several hours and zero dollars.

Your mileage may vary!

Neil Rieck
Waterloo, Ontario, Canada.
https://neilrieck.net/OpenVMS.html



More information about the Info-vax mailing list