Hi, Just wondering if using the C code that GNUCobol compiles to would it be possible to convert COBOL programes/systems to C?
If so you can put all us old Cobblers out to pasture!
If you've ever looked at the generated C code, it's not tight and concise code. It's generated code that has a lot of added bloat to allow it to mimic how a running COBOL program acts. It also was never intended to be used as a language converter, except to get the code past a C compiler, so it's not very human friendly code. Because of these reasons, yes it will create some C code that mirrors the function of the COBOL program, but it will be an impossible to maintain and enhance pile of fairly ambiguous C.
If you were needing to move your code base from COBOL to C, I would get some programmers that are fluent in both. They do exist. Look for grey hair and wrinkles.
GnuCOBOL translates the COBOL source to C, then runs it through the Gnu C compiler. I believe the only "mainframe" that the Gnu C compiler can target is an IBM 390 running Linux. I don't think it can natively target a non-Linux OS except for Windows or Mac OS/X. I could be wrong, but I wouldn't mix environments.
In general, you should always develop and maintain code on the same architecture as your production environment. If you are programming for a mainframe, you should be using a native compiler for that HW/OS combination. That will save you many headaches and huge expense in the long run.
There is a GnuCOBOL FAQ that explains a lot about it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.