2

I'm converting a set of COBOL programs written for Microfocus's compiler for use with GnuCobol. So far, I've been moderately successful, only having to change some microfocus-specific date commands, along with using GnuCobol's -std=mf argument.

I'm using a pre-built build from www.arnoldtrembley.com/GnuCOBOL.htm

I'm having trouble with this error when running a certain file after successfully compiling:

libcob: module '»' not found

After playing around in OpenCOBOLIDE, I found that the offending line is

 CALL X"AF" USING SET-BIT-PAIRS
                               USER-KEY-CONTROL

What can I do to fix this?

Kurtoid
  • 207
  • 6
  • 14

1 Answers1

2

You'll need to recode that part. GnuCOBOL only supports a few of the numbered system support routines. x"91", x"E4", x"E5", x"F4" and x"F5". x"AF" isn't in the list of built in system library routines yet. And even the supported ones don't include handling of all of the sub-functions.

As x"AF" is screen related (at least from the one document page I've seen), you can probably just figure out what escape codes to send to the terminal and do that part manually with DISPLAY instead of CALL.

Without knowing what x"AF" sub-function is being called, (whatever is in SET-BIT-PAIRS) it is impossible to come up with a specific VT100 sequence to suggest trying. If it is simply sub-function 18 then DISPLAY of a single character WITH NO ADVANCING will probably suffice. Sub-function 22 just means ringing the terminal bell which can be done by emitting a Ctrl-G. Etc.

If you are curious, run cobc --list-system (or just look in the GnuCOBOL Manual which is included in the pre-built package you use) to see what stock system library calls are supported with GnuCOBOL.

And if you are adventurous, you are free to look in the compiler source code tree and just change libcob to support the code you have by linking the CALL number to a C function, extending libcob/system.def with the new entry and rebuilding GnuCOBOL from source.

Simon Sobisch
  • 4,650
  • 11
  • 33
Brian Tiffin
  • 3,718
  • 1
  • 20
  • 34