Examples of compiling programs with ACUCOBOLGT

With ACUCOBOL-GT, the syntax for compiling the same COBOL program might look like this:

:ccbl "-Cp –Lof HELLOLST –o HELLOOBJ HELLOCBL"

where:

-Cp tells the compiler to use HP COBOL compatibility mode;

-Lof HELLOLST creates a full listing file called HELLOLST;

-o HELLOOBJ creates an object file called HELLOOBJ; and

HELLOCBL is the name of the source COBOL program.

For a quick reference to all of the compiler options type:

:ccbl "-help"
Note: You should use the command line options in lieu of the HP COBOL $CONTROL directives. See $CONTROL Directive for a table that maps HP COBOL $CONTROL directives to the ACUCOBOL-GT command line options for the compiler and the runtime.

Here are some other options that you might use while compiling HP COBOL programs with ACUCOBOL-GT:

"-Rw" - suppresses individual ACUCOBOL-GT reserved words. If your HP COBOL program uses words that are not HP COBOL reserved words, but are ACUCOBOL-GT reserved words, a compile time error occurs. For example, if your HP COBOL program has a working storage item called BELL or BEEP, the program will not compile unless you use the "Rw" option because these words are ACUCOBOL-GT reserved words. You can suppress reserved words with the "-Rw" option on the compiler command line, like this:

:ccbl "-Rw BELL –Rw BEEP -Cp –Lof HELLOLST 
     –o HELLOOBJ HELLOCBL"

"-Di" - causes the compiler to initialize Working-Storage . Many of the problems that surface due to differences in the that way HP COBOL and ACUCOBOL-GT initialize (or not initialize) data items by default, can be avoided by compiling with "-Di". When "-Di" is specified, data items are initialized according to their type. For more information about "-Di", see Data Storage Options.

"-Gd" - compiles for source debugging (this option includes the source code in the compiled object file). You then invoke the debugger with the "-d" option on the ACUCOBOL-GT runtime command line ("runcbl").

"-v" - tells the compiler to output information about what it is doing during compilation.