COBOL Manual for TNS/E Programs (H06.03+)

Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS/E Programs520347-003
22-15
Naming the Object File
Naming the Object File
To simplify the compilation examples in the preceding topic, no name is specified for
the object file that the compiler produces. In these examples, the object file is given the
default name RUNUNIT. To specify a name for the object file, type the name after the
final slash, as in this example, which names the object file XYZOBJ:
88> ECOBOL /IN XYZ, OUT $SPX/ XYZOBJ; RUNNABLE
Although program compilation is a single-step process from the users viewpoint,
producing a loadfile actually involves the linker. The linker resolves the external
references in CALL and ENTER statements and the implicit calls to HP COBOL run-
time library routines that many HP COBOL statements cause.
If you specify the CALL-SHARED and RUNNABLE directives, and there are no
compilation errors, the ECOBOL compiler calls the eld utility, which produces a PIC
loadfile. If you specify the SHARED and RUNNABLE directives, and there are no
compilation errors, the ECOBOL compiler calls the eld utility, which produces a DLL.
The ECOBOL compiler:
1. If the object file already exists and it is not a code 800 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 800 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 ECOBOL compiler tries the name ZZNCnnnn, where nnnn is a sequence of
randomly chosen alphanumeric characters. If the ZZNCnnnn name that the ECOBOL
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. The ECOBOL
compiler cannot replace the executing version of OBJFILE, so the linker renames the
old object file ZLDAFnnn 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.
Use the TACL command FILES to detect ZZBInnnn or ZZNCnnnn files and the TACL
command PURGE to purge the unwanted ones.