What's the basic difference between COBOL used on mainframe.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Nikunj Tanna
Registered Member
Posts: 15
Joined: Sat Dec 14, 2013 11:38 pm

What's the basic difference between COBOL used on mainframe.

Post by Nikunj Tanna »

Hi,

What's the basic difference between COBOL used on mainframe and on a PC, like MF Cobol? Also, is the underlying code is same and portable to one platform to other?
Thanks,
Nikunj
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What's the basic difference between COBOL used on mainfr

Post by Robert Sample »

As long as the COBOL compilers are using the same language specification (such as COBOL-85 or COBOL-2002), the COBOL will be the same. The executable code will be completely different and depends upon the platform. There are some differences between platforms (usually different compilers will implement different extensions to the language, and the method of identifying external files varies by compiler), but the actual COBOL logic will generally run the same. Of course, it all depends upon the programmer -- if the program is written to depend upon the ASCII code page, then the program will execute differently on a mainframe with an EBCDIC code page.
dick scherrer
Former Team Member
Posts: 62
Joined: Wed Aug 07, 2013 6:43 pm

Re: What's the basic difference between COBOL used on mainfr

Post by dick scherrer »

The basic difference is the underlying operating environment.

COBOL systax is quite protable, but platform specific operations (like disk and terminals) are typically not transferrable.

Also, as Robert mentioned, code pages can make a difference.
Hope this helps,
d
Nikunj Tanna
Registered Member
Posts: 15
Joined: Sat Dec 14, 2013 11:38 pm

Re: What's the basic difference between COBOL used on mainfr

Post by Nikunj Tanna »

Thanks Robert and Dick.

I asked this question as I thought of using MF Visual Basic COBOL and the z390 mentioned on this board to code a COBOL program and then later taking that program to the mainframe but I was not sure that could be done successfully.
Thanks,
Nikunj
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What's the basic difference between COBOL used on mainfr

Post by Robert Sample »

I have moved quite a few programs from a mainframe to a PC using Open COBOL (now GNUCOBOL) with the only change needed being how the external files were identified. Furthermore, I have moved a CICS COBOL program from the mainframe to the PC using Open COBOL, but that required quite a few changes as a SCREEN SECTION needed to be added, the EXEC CICS commands had to be changed to screen I/O commands, and the VSAM file was converted to an indexed file. Once the changes were made, however, the PC program ran the same way as the CICS program and the screen displays matched the CICS screens.

The bottom line is that COBOL is very portable from platform to platform, but there will generally be some changes in the platform-dependent pieces of the program.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”