Page 1 of 1

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

Posted: Mon Dec 16, 2013 9:25 pm
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?

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

Posted: Mon Dec 16, 2013 11:49 pm
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.

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

Posted: Tue Dec 17, 2013 2:04 am
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.

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

Posted: Wed Dec 18, 2013 2:16 pm
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.

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

Posted: Wed Dec 18, 2013 6:54 pm
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.