Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Options for the linkage run

The following linkage editor options have no effect if the -c option is used to terminate the compiler run once compilation is complete. The cobol command issues a warning for any such unused option.
General information on linking and the linking order is provided in section "Linking".

–L directory

You use this option to specify path names of directories that the linkage editor is to search for libraries named libname.a. These libraries must be specified with the -l name option. By default, only /usr/lib and /usr/ccs/lib are searched for libraries.The order of the -L options is significant. The directories specified with -L are always searched with higher priority, i.e. before the default directories.
The -L options must be specified before the -l options to which they apply.

–M name

name must be the PROGRAM-ID name of the COBOL main program in uppercase letters. This option must always be specified if the main program is a COBOL program.

–o output-file

The executable file generated by the linkage editor is written to output-file.
If
output-file does not include any directory components, the file will be stored in the current directory; otherwise it will be stored in the directory specified as part of output-file.
By
default, the executable is stored in the current directory under the name a.out. The following must be noted here: both write and read access rights are required for the output file.

–l name

This option causes the linkage editor to search the library named libname.a when resolving external references using the AUTOLINK mechanism.
If no other directory is specified with the linkage editor’s -L option, the linkage editor looks for the specified library in /usr/lib and /usr/ccs/lib.
The sort library libsort.a (for example) is not in the default directories, but is installed as a PLAM library in BS2000. This also applies to the runtime system library libc.a.
T
he linkage editor searches the libraries in the order in which they appear in the command line.

–l BLSLIB

This option causes the linkage editor to scan PLAM libraries that have been assigned using the shell environment variables named BLSLIBnn (00 <= nn <= 99). The environment variables must have been assigned the library names and exported with the POSIX export command before the compiler is invoked. The libraries are scanned in ascending order of nn.
All the libraries assigned with the BLSLIBnn environment variables are internally passed to the BINDER in list form in a single RESOLVE statement.

Example 14-5

export BLSLIB00='$RZ99.SYSLNK.COB.999'
export BLSLIB01='$MYTEST.LIB'
cobol mytest.o -l BLSLIB -M MYTEST