Linking

To HP developers in general, the term linking means running a command or series of commands that arrange all of a program's objects so that they can run as a single application.

In ACUCOBOL-GT, linking describes the linking of C subroutines or HP RLs into the ACUCOBOL-GT runtime so that the runtime can CALL the functions that these routines provide. Programs compiled with ACUCOBOL-GT do not require linking.

For example, linking three COBOL objects that are HP COBOL objects gives you an HP executable program:

OBJECT1 + OBJECT2 + OBJECT3 = HPEXE

To run the HP executable enter:

:RUN HPEXE

If these three COBOL objects are ACUCOBOL-GT objects, you do not link them together; they remain separate object files:

OBJECT1

OBJECT2

OBJECT3

The ACUCOBOL-GT runtime is used to execute these objects. Assuming that OBJECT1 is the main program, the command to run might look like this:

:RUN /ACUCOBOL/bin/runcbl;INFO="OBJECT1"

or

:runcbl "OBJECT1"

To execute OBJECT2 and OBJECT3, the main program (OBJECT1) makes a CALL to one of the other objects, and the ACUCOBOL-GT runtime dynamically loads and runs the called object. The main program may CALL all of the other objects one by one in the following pattern:

OBJECT1 CALLs OBJECT2; OBJECT1 CALLs OBJECT3; etc.,

The CALLed object can CALL the next object in the execution sequence (OBJECT1 CALLs OBJECT2; OBJECT2 CALLs OBJECT3; etc.)