Compiling Your Applications

The products from the Visual COBOL suite include a lot of enhancements and some changes in behavior when compared to Server Express. Because of this, when you upgrade to Micro Focus Visual COBOL Development Hub from an earlier Micro Focus product you must recompile your applications using Micro Focus Visual COBOL Development Hub.

To compile your existing programs from a terminal window directly on the UNIX machine:

  1. Ensure that Micro Focus Visual COBOL Development Hub is installed and configured on the remote machine where you store your existing COBOL programs.
  2. Log onto the UNIX machine and from a terminal window and compile your programs using the cob command or the build scripts or makefiles used to build the application with Server Express.

    Remember to review and reuse all Compiler directives that were previously used when compiling the application in Server Express.

Most programs created with Server Express should compile cleanly using your existing build scripts and makefiles without any changes to your code, as Micro Focus Visual COBOL Development Hub also provides the cob utility to create .int, .gnt or .o files.

Fixing compilation issues

Because Micro Focus continues to enhance the COBOL language, you might encounter some problems when compiling your existing Server Express applications in Visual COBOL.

For example, the list of reserved COBOL words changes with each new level of the COBOL language, so an application created with an older Micro Focus product might use data names that are now reserved keywords in Visual COBOL. If this happens, a COBOL syntax error COBCH0666 ("Reserved word used as data name or unknown data description qualifier") occurs. See Reserved Words Table in this product help for a comprehensive list of reserved words and the levels at which they are supported.

Also, these Server Express Compiler directives are no longer supported:

  • 01SHUFFLE
  • 64KPARA
  • 64KSECT
  • AUXOPT
  • CHIP
  • DATALIT
  • EANIM
  • EDITOR
  • ENSUITE
  • EXPANDDATA
  • FIXING
  • FLAG-CHIP
  • MASM
  • MODEL
  • OPTSIZE
  • OPTSPEED
  • PARAS
  • PROTMODE
  • REGPARM
  • SEGCROSS
  • SEGSIZE
  • SIGNCOMPARE
  • SMALLDD
  • TABLESEGCROSS
  • TRICKLECHECK
  • WB2
  • WB3
  • WB

and the pseudovariables of the following Server Express environment variables are obsolete and can't be used:

  • BASENAME
  • FILENAME
  • PATH
  • TARGETDIR

You should consider using the following methods to solve such issues:

  • Rewrite the source to avoid using these keywords in your code and directives files.
  • Use the REMOVE Compiler directive to remove individual keywords from the reserved words list.
  • Use the MF or MFLEVEL Compiler directive to select an earlier version of Micro Focus COBOL that your code is compatible with. For example, setting MFLEVEL"12" ensures compatibility with Mainframe Express 3.0 and 3.1, Net Express 4.0, 5.0, and 5.1, and Server Expresss 4.0, 5.0, and 5.1. Refer to Reserved Words Table in this product help for the value to use to ensure support for your existing reserved words.

To use REMOVE from the terminal window, type the following:

cob myprogram.cbl -C remove=title

The command above removes TITLE as a keyword from the language so you can use it as an identifier in a COBOL program.

To use the set of reserved words that was used for Server Express v5.1 WrapPack 5, use this command line:

cob myprogram.cbl -C mflevel=15

To set either one of the directives in your source code, type the following starting with $ in the indicator area of your COBOL program:

$set remove "title"

Or:

$set mflevel"15"