0

So I was helping my dad's small business in Taiwan migrate old COBOL application from a very old XP computer to a Windows 11 computer.

I copied all the COBOL files and installed OpenCobolIDE on the new computer. However, the IDE cannot open the file as the encoding is not correct.

Is there a simple fix? I spent the whole day playing with different IDEs but in vain. As I have zero knowledge of COBOL, if it is too difficult to migrate, I will probably write a complete new system for my dad. The one who wrote it has already retired and no one took over his job. Thank you! ................

Here are the details. The main file is TNMENU.COB. On the old computer, it was run by RM/COBOL, and the interface looks like this (it basically a menu of options)

On the new computer, the IDE cannot read the file. The hex values are given here.

I tried different IDEs, but all showed bad characters.

  • I guess you don't want to just use the application (would mean copy the .exe files over and run them) or the application's code (just recompile with the same options, possibly using new gnucobol version), but also an development environment? Do you still have access to the running WinXP environment to check compile options? I suggest you try to use vscode with bitlang.gnucobol extension and/or the gix ide if your encoding issue persists. If those IDEs solve the issue you may ask at https://sourceforge.net/p/gnucobol/discussion/help/ if you need help to setup the compilation. – Simon Sobisch Jan 03 '23 at 11:08
  • This issue itself is not about COBOL (or GnuCOBOL) [because the compiler does not present an error] but about the IDE. The encoding seems to not be known to the python/qt environment OCIDE uses then. This could either be related to python/qt (but I think this is bundled/embedded in the install), to their work with the newer OS (as the IDE is not maintained it would be a bit hard to update those) or with the new OS missing one of the installed system languages (I'd check that first). – Simon Sobisch Jan 03 '23 at 11:11
  • 3
    .COB files are compiled object files they are not meant to be read. They are like Java class files and require the RM runtime to execute. The source files are most likely .CBL or .LST if you can find them. – Jim Castro Jan 04 '23 at 05:57

1 Answers1

1

As you found out: There are a lot of hex values in your ".COB", so (as jimcastro) pointed out, those are not COBOL source files but compiled sources in a format that is loaded/executed from the old environment's runtime RM/COBOL.

To move these to the new environment: as long as the RM/COBOL runtime is 32bit: just copy it along and use it on the new computer.

If the runtime is 16bit it won't work on newer environments directly, you could try with an emulator or virtual machine (DOSBOX or FreeDOS running in VirtualBox for example).

As an alternative: if the COBOL source code is available then you could recompile it with GnuCOBOL using -std=rm-strict, allowing you to run in in 64 (or 32) bit on nearly every operating system.

Simon Sobisch
  • 6,263
  • 1
  • 18
  • 38
  • Thank you. You are right. We contacted the retired employee and he said we need source file which has been long gone. I am trying to copy the environment now. Thanks! – Danny I Tan Lin Jan 11 '23 at 04:14