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-16
Naming the Object File
Using an HP editor, you can create OBEY command files. OBEY command files
contain TACL commands, such as the COBOL85 or NMCOBOL commands, which are
executed when you specify the name of the OBEY command file in an OBEY
command. Here is a sample session:
45> EDIT CFILE1
TEXT EDITOR - T9601D10 - (08JUN92)
$VOL3.SUBVOL2.CFILE1 DOES NOT EXIST. SHALL I CREATE IT? Y
CURRENT FILE IS $VOL3.SUBVOL2.CFILE1
*ADD
1 COBOL85 /IN XYZ,OUT $SPX.#HOLD/
2 //
*EXIT
46> OBEY CFILE1
The command OBEY CFILE1 causes execution of the command:
COBOL85 /IN XYZ,OUT $SPX.#HOLD/
An OBEY command file can contain more than one command. If another OBEY
command file, CFILE2, contains the commands
COBOL85 /IN XYZ,OUT $SPX.#HOLD/
PERUSE
the command OBEY CFILE2 is equivalent to the command series
47> COBOL85 /IN XYZ,OUT $SPX.#HOLD/
48> PERUSE
For more information about OBEY command files, see the Guardian Users Guide.
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> COBOL85 /IN XYZ, OUT $SPX/ XYZOBJ
88> NMCOBOL /IN XYZ, OUT $SPX/ XYZOBJ; RUNNABLE
Although program compilation is a single-step process from the users viewpoint,
producing a loadfile actually involves Binder (for the COBOL85 compiler) or the linker
(for the NMCOBOL compiler). Binder or 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.
During most of the time that the COBOL85 compiler executes, Binder runs as a
separate process called BINSERV. The COBOL85 compiler communicates with
BINSERV through interprocess messages.