Compaq COBOL AAQ2G1FTK User Manual

Page 71

Advertising
background image

Developing Compaq COBOL Programs

1.3 Developing Programs on OpenVMS Alpha

2.

Calls a Compaq COBOL program that contains CALL by data name, extended
ACCEPT, or extended DISPLAY statements.

Compaq COBOL uses the LIB$INITIALIZE routine, COB_NAME_START, to
initialize the run-time environment for the CALL by data name and extended
ACCEPT and DISPLAY statements. Therefore, the COB_NAME_START routine
must be invoked before any CALL, ACCEPT, or DISPLAY statements are
performed.

The order in which LIB$INITIALIZE routines are invoked is determined during
the link and is shown in the image map. To ensure that the Compaq COBOL
LIB$INITIALIZE routine is invoked first, change your link command to the
following:

$ LINK/EXE=name SYS$SHARE:STARLET/INCL=COB_NAME_START,your_modules...

See Appendix B for information on a problem with LIB$INITIALIZE when you
call a C program.

1.3.3.4 Specifying Object Module Libraries

Linking against object modules allows your program to access data and routines
outside of your compilation units. You can create your own object module libraries
or they can be supplied by the system.

User-Created Object Module Libraries

You can make program modules accessible to other programmers by storing them
in object module libraries. To link modules contained in an object module
library, use the /INCLUDE qualifier with the LINK command

2

and specify

the modules you want to link. The following example links the subprogram
modules EGGPLANT, TOMATO, BROCCOLI, and ONION (contained in the
VEGETABLES library) with the main program module GARDEN:

$ LINK GARDEN, VEGETABLES/INCLUDE=(EGGPLANT,TOMATO,BROCCOLI,ONION)

An object module library also contains a symbol table with the names of the
global symbols in the library, and the names of the modules in which the symbols
are defined. You specify the name of the object module library containing these
symbol definitions with the /LIBRARY qualifier. When you use the /LIBRARY
qualifier during a linking operation, the linker searches the specified library for
all unresolved references found in the included modules during compilation.

The following example uses the library RACQUETS to resolve undefined symbols
in the BADMINTON, TENNIS, and RACQUETBALL libraries:

$ LINK BADMINTON, TENNIS, RACQUETBALL, RACQUETS/LIBRARY

For more information about the /INCLUDE and /LIBRARY qualifiers, invoke the
online HELP facility for the LINK command at the DCL prompt or refer to the
OpenVMS Linker Utility Manual.

You can define one or more of your private object module libraries as default
user libraries. The following section describes how to accomplish this using the
DEFINE command.

2

The /INCLUDE qualifier on the LINK command is not to be confused with the /INCLUDE
qualifier on the COBOL compile command, which specifies a search list for COPY files.

Developing Compaq COBOL Programs 1–41

Advertising