COBOL Manual for TNS and TNS/R Programs

Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS and TNS/R Programs522555-006
22-17
Naming the Object File
If you specify the CALL-SHARED and RUNNABLE directives, and there are no
compilation errors, the NMCOBOL compiler calls the ld utility, which produces a PIC
loadfile. If you specify the SHARED and RUNNABLE directives, and there are no
compilation errors, the NMCOBOL compiler calls the ld utility, which produces a DLL.
Binder does the actual building of the object file. If there are no compilation or binding
or linking errors, and file XYZOBJ either does not exist or is secured such that Binder
can purge it, Binder puts the new version of XYZOBJ on the disk. If you do not specify
a name for the object file, Binder or the compiler uses the default name RUNUNIT.
Binder tries these names, in this order:
1. ZZBInnnn, where nnnn is a sequence of randomly chosen alphanumeric
characters
2. OBJECT
Binder can name the new object file OBJECT only if no file named OBJECT
already exists. If a file named OBJECT already exists, Binder names the new
object file ZZBInnnn.
The NMCOBOL compiler:
1. If the object file already exists and it is not a code 700 file, the compiler attempts to
create the file named OBJECT. If this file exists or is open by another process, the
compiler creates a file named ZZNCnnnn, where nnnn is a sequence of randomly
chosen alphanumeric characters.
2. If the object file already exists and is a code 700 file and is not open by another
process, it is purged and a new one is created.
3. If the object file is open by another process, the compiler renames the existing file,
giving it the name ZZNCnnnn where nnnn is a sequence of randomly chosen
alphanumeric characters. The specified object file is then created. If the existing
object file cannot be renamed, the compilation terminates.
The NMCOBOL compiler tries the name ZZNCnnnn, where nnnn is a sequence of
randomly chosen alphanumeric characters. If the ZZNCnnnn name that the
NMCOBOL compiler tries already exists, the compiler tries another one (with a
different sequence of randomly chosen alphanumeric characters). The compiler tries
several different ZZNCnnnn names if necessary, but does not keep trying indefinitely.
If the compiler stops trying to name the object file, verify that you have create access to
the designated subvolume.
Suppose that you specify the name OBJFILE for the object file, but the operating
environment is executing a process from a file named OBJFILE. Binder or the
NMCOBOL compiler cannot replace the executing version of OBJFILE, so Binder or
the linker renames the old object file ZZBInnnn or ZZNCnnnn, respectively, and
names the new object file OBJFILE as you specified. The next user who executes the
object program named OBJFILE executes the new object file, even if another user is
still executing the old, renamed one.