×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

using GNUCobol to convert systems writtrn in cobol to C

using GNUCobol to convert systems writtrn in cobol to C

using GNUCobol to convert systems writtrn in cobol to C

(OP)
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!

RE: using GNUCobol to convert systems writtrn in cobol to C

Possible? Yes. A good idea? No.

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. bigsmile

RE: using GNUCobol to convert systems writtrn in cobol to C

(OP)
Thanks for your reply Sam, makes sense.
Can I use GNUCobol to develop / maintain cobol programs running on mainframes?

RE: using GNUCobol to convert systems writtrn in cobol to C

"Can"?!?

Again, yes you can. Should you? Probably not.

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close